[Mobile] Set up Android real devices
This article shows you how to set up real Android devices to test Android applications with Katalon Studio.
For mobile testing with Android Studio Emulator, refer to this document: [Mobile] Configure Android Studio (Emulator).
1. Install Appium​
-
Download and install the suitable version of Node.js for your system from the Node.js website: Downloads.Make sure you install Node.js into a location where you have full
Read/Writepermissions. -
Install Appium 3 and the Appium UiAutomator2 Driver (v7.0.0+) with the following commands in the Terminal:
npm i --location=global appium@3.0.0
appium driver install uiautomator2@7.0.0
Some emulators come with Appium installed. If you want to run an application on an emulator, check your emulator settings before installing Appium.
- If you see an
EACCES errorwith the Appium installation command, follow the instructions of npm documentation here: Resolving EACCES permissions errors when installing packages globally. - If you encounter an error where the Java
jarfile can't be found, you might need to add the environment variable:KATALON_JAVA_HOME= <JRE_location>. See related discussion on Ask Ubuntu: How to set JAVA_HOME for Java?. - Set the Appium directory manually in Katalon Studio Preferences. The default directory should be
/usr/lib/node_modules/appium/.
2. Set up the device​
-
Go to Settings > Developer options to turn on developer mode on your Android device.
On a Windows machine, you also need to enable the following settings:
- USB debugging – Debug mode when USB is connected.
- Install via USB – Allow installing apps via USB.USB debugging
- (Security Setting) – Allow granting permissions and simulating input via USB debugging.
-
Connect your Android phones to your computer via a USB cable and confirm to accept or trust the device.
-
Install Android SDK.
Katalon Studio will automatically detect and ask you to install Android SDK if your current machine does not have it.
3. Verify successful Android devices connection​
After completing setting up your environment, to check whether Katalon successfully recognizes your Android devices, open a sample Android project in File > New Sample Project.
On the main toolbar, open the dropdown list next to Run and select the Android device.
You should see the name of your Android device in a pop-up dialog.