- Install Java:
- First, ensure that the Java Development Kit (JDK) is installed. You can verify this by running
java -versionin the terminal. - If not installed, use the following command to install Java:
bash
sudo apt update sudo apt install openjdk-11-jdk
- Install Node.js and npm:
- Appium requires Node.js. Install it using the following command:
bash
sudo apt install nodejs sudo apt install npm
- Install Appium:
- Install Appium globally via npm:
bash
npm install -g appium
- Install Android SDK:
- The Android SDK is necessary for automating Android applications.
- Download and extract the Android SDK, then add its path to your environment variables:
bash
export ANDROID_HOME=/path/to/android/sdk export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
- Configure Environment Variables:
- Set the correct environment variables to ensure all tools are accessible.
- Add the export commands for
ANDROID_HOMEandPATHto your.bashrcor.profilefile, then runsource ~/.bashrcto apply the changes.
- Start the Appium Server:
- Launch the Appium server using the command line:
bash
appium
- Verify Installation:
- To confirm the setup, run a simple test script to verify Appium can connect to an Android emulator or physical device.
These steps outline the process for installing and configuring Appium on Ubuntu for Android automation. Ensure all tools and dependencies are correctly installed, and environment variables are properly configured to enable seamless communication between Appium, the Android SDK, and Java.