Android Devices
Eggplant Gateway for Android runs on Windows, Linux, and macOS. It supports testing on real, physical Android devices over Wi-Fi and USB.
note
Starting with Eggplant Gateway v25.4.9, Android devices must be running Android 8.0 (Oreo) or later. Earlier Android versions are no longer supported.
Enabling Automation on Your Android Device
To enable test automation on your Android device, follow these steps:
- Enable developer mode on your Android device.
- Go to Settings and search for "Build Number" (or "MIUI Version" on XIAOMI devices) in the search panel.
- Tap the Build Number text at least 6 times, until the "You are now a developer" message appears.
- Configure USB Debugging.
- Go to Settings > Developer Options and turn on USB Debugging in the Debugging section. When asked to confirm, tap OK.
- Connect your Android device to your PC using a USB cable.
- A pop-up saying "Allow USB Debugging" will appear on your device. Choose to Always allow from this computer and tap OK.
- In order to allow the
SetDeviceLocationcommand to work when necessary, you must enable Mock Location on your Android device. To do this:- Go to Settings > Developer Options and turn on Mock Locations.
Creating a Connection
To create an Eggplant Gateway connection to an Android device, run the following command:
epgw add android
--name <name> (REQUIRED)
--serial <serial>
--adbPath <path>
--maxFps <maxFps>
--bitRate <bitRate>
--maxSize <maxSize>
--stayAwake <false>
For example, epgw add android --name android
The available options are:
| Key | Description |
|---|---|
name | The connection name |
serial | The Android device serial. You can omit this parameter if exactly one Android device is connected to your computer. |
adbPath | The ADB executable path. |
maxFps | The max fps set for scrcpy. [default: 60] |
bitRate | The bit rate set for scrcpy. [default: 8000000] |
maxSize | The max size set for scrcpy. [default: 0] |
stayAwake | The stay awake option set for scrcpy. [default: False] |
help | Show help and usage information |
Connecting to Eggplant Functional
Follow these steps to start an emulator through Eggplant Functional:
- Run
epgw vnc <name>, where name is the name of your Gateway connection. For example,epgw vnc android.- Eggplant Gateway will start:
- A VNC server at port 5900
- A WebDriver server at port 5000
- Eggplant Gateway will start:
- Start Eggplant Functional and manually add your device to the connection list.
See Also
- Automatic Android Device Detection — Have Eggplant Gateway automatically create connections for Android devices connected over USB or Wi-Fi.