Appium has the following requirements:
- Node.js and npm
- Java Development Kit (JDK)
- Android SDK > 16
- Android platform tools (for
- Android build-tools (for
If you want to test iOS apps, you also need XCode. On top of that, if you want to test on a local iOS device you need to have a valid Apple developer account.
Follow the step-by-step installation guide to install and verify each of these components.
To install Node.js on a Mac, it is recommended to use Homebrew. A little set-up in the beginning, can save you from some headaches later on!
- Open your Terminal. Press Command - spacebar to launch Spotlight and type "Terminal," then double-click the search result.
- See if Homebrew is installed by running
brew -v. You should see “Homebrew” and a version number.
- If not, download and install Homebrew with the instructions.
- Once you’ve installed Homebrew, repeat step 2 to verify.
brew install node in the terminal to install Node
Or, download the macOS Installer sourced from the nodejs.org web site.
Java Runtime Environment (JRE): Simply put, JRE is an environment that helps you run Java programs.
Java Development Kit (JDK): JDK would be required if you want to write Java programs. When you install JDK, then both JDK and JRE will be installed on your machine.
You need to have JDK (Java Development Kit) installed and
JAVA_HOME set in your environment.
- Download JDK 8. Our recommendation is to update to the most recent version of Java 8 to avoid issues with Appium. You can have multiple versions of Java also.
- Ensure that the
JAVA_HOMEenvironment variable is also set to the JDK path.
- Determine whether Java is installed by using the command
You will see something like this - "/usr/bin/java"
- Next Step will be to determine the version of Java Installed by using the command
You will see something like java version "1.8.0_241". The latest version as of January 27, 2020, is "1.8.0_241".
- Next step will be to get the location where the Java is installed:
- Under the Java folder, select the folder with the version that was displayed earlier:
- Next check if Java_Home is setup to the correct location:
It will result in blank output if it is not already setup. If it returns the location, check if it points to the correct folder.
- You can add or update the Java_Home using the below commands (depending on which shell you use):
- Navigate to the end of the file by pressing "Shift + g". Now press "i" to get to insert mode. Add the below lines in the bash_profile after replacing the path to the java home directory on your mac
# Setting Java_Home
Save this by pressing Esc followed by ":wq!"
- Finally, open a new terminal window and test the variable is setup correctly:
It should return the Java_Home path setup
- Download the latest Java 8 version from the JDK Downloads page. On this page, Accept License Agreement and then download the JDK for Windows based on whether you have Windows 32-bit or 64-bit operating system.
- Run the downloaded .exe file and start installation process. We recommend using default options for Java installation.
- To verify that the installation is successful, open Java folder in Program files. You would see that new JRE & JDK folders with the latest version numbers have been created. Don’t worry if you see previous versions of JRE or JDK folders in there. Multiple versions of JDKs & JREs can co-exist.
- Copy the folder location where the latest version of JDK is installed. For a 64-bit system, this would look like - C:\Program Files\Java\jdk1.8.0_241 where 241 is the latest java version.
- You have to now open the environment variables window in your machine. To do this, click on the Start menu. Then right-click on Computer and select Properties option. Click on Advanced System Settings option.
- Now from the Advanced Tab, click on the Environment Variables button. Set the following user environment variables.
JAVA_HOME : C:\\Program Files\\Java\\jdk1.8.0_241JDK_HOME : %JAVA_HOME%JRE_HOME : %JAVA_HOME%\\jreCLASSPATH : .;%JAVA_HOME%\\lib;%JAVA_HOME%\\jre\\libPATH : your-unique-entries;%JAVA_HOME%\\bin (make sure that the longish your-unique-entries does not contain any other references to another Java installation folder)
Notice that these environment variables are derived from the "root" environment variable
JAVA_HOME. This makes it easy to update your environment variables when updating the JDK. Just point
JAVA_HOME to the fresh installation.
- Verify the installation. Open a command prompt. Run the command
javac -version. This should show the javac version number. Verify that this version number is the same as the latest JDK version (from JDK folder name). You can also run the command
where javac. This command should show the JDK bin folder location. This should be the same folder location that you had set in the Path variable
If you want to set up for Android, you need to install the Android SDK and set up
ANDROID_HOME. There are 2 different ways in which you can download and install Android SDK tools –
- By downloading Android Studio: Android Studio is the official IDE for creating Android apps and running Android Virtual Devices. When you install Android Studio, SDK tools come bundled with it
- By downloading Command Line tools: If you do not need Android Studio, you can download the basic Android command-line tools. It comes with sdkmanager, using which you can download other SDK tools and packages
- Install android from the command line tools as follow.
brew tap caskroom/cask\nbrew cask install android-sdk
- Download and Install Android Studio. Download and run the dmg for Mac (64-bit).
- Set the
ANDROID_HOMEenvironment variable to match this path. For example, if you installed the SDK to /usr/local/adt, then there will typically be an SDK folder inside of that which contains the SDK files. Add the following line to your login script (~/.bash_profile):
- Download and Install Android Studio. Download and install the 32-bit or 64-bit version depending on your Windows OS version.
- Follow the instructions in the installation wizard and use default options to complete the installation.
- Next, the main Android environment variables that you would have to set are ANDROID_HOME and Path variables.
- By default, Android SDK is installed in this folder –
C:\Users\<YourUserName>\AppData\Local\Android\sdk. Go to this folder and verify it. Copy this folder path.
- Open the System Properties window. Now from the Advanced Tab, click on Environment Variables button. Set the following user environment variables:
ANDROID_HOME : C:\Users\<YourUserName>\AppData\Local\Android\sdk
PATH : your-unique-entries;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;%ANDROID_HOME%\tools\bin
Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. adb is included in the Android SDK Platform-Tools package.
Run these commands. For example, here's how to install the latest platform tools (which includes adb) and the SDK tools for API level 28:
sdkmanager "platform-tools" "platforms;android-28"sdkmanager "platform-tools"
- Open any existing project in Android Studio, or create a new sample project
- Once your Android Studio project is opened, go to Tools > SDK Manager
- Under the SDK Tools tab, select these two packages: Android SDK Platform-Tools Android SDK Build Tools
Click Apply or OK to download.
Verify by running this command
adb devices. This will show you any devices that are currently plugged into your machine.
Xcode includes everything developers need for iOS apps.
Follow the steps below to install XCode. You will need an Apple Developer account for testing on real iOS devices locally. When prompted to log in, you should be able to use the same email and password you use for your Apple Developer Account. If you don't have a developer account then you will only be able to run tests on virtual iOS devices (Simulators) using your Apple ID.
- Click on this link to Xcode on the Mac App Store, then click on "View in Mac App Store"
- It should automatically launch the "App Store" app on your Mac and take you to the Xcode page. Click on the "Free" button, then click on "Install App."
- Once the installation is complete, go to your Applications folder and double-click on Xcode, then install any required components if asked to.
- Go to Xcode's Preferences via the menu bar, or by pressing the command and comma keys.
- Click on the "Downloads" icon, then click on the "Install" button next to "Command Line Tools."