Skip to main content

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.

Enabling Automation on Your Android Device

To enable test automation on your Android device, follow these steps:

  1. 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.
  2. Configure USB Debugging.
    • Go to Settings > Developer Options and turn on USB Debugging in the Debugging section. When asked to confirm, tap OK.
  3. 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.
  4. In order to allow the SetDeviceLocation command 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:

KeyDescription
nameThe connection name
serialThe Android device serial. You can omit this parameter if exactly one Android device is connected to your computer.
adbPathThe ADB executable path.
maxFpsThe max fps set for scrcpy. [default: 60]
bitRateThe bit rate set for scrcpy. [default: 8000000]
maxSizeThe max size set for scrcpy. [default: 0]
stayAwakeThe stay awake option set for scrcpy. [default: False]
helpShow help and usage information

Connecting to Eggplant Functional

Follow these steps to start an emulator through Eggplant Functional:

  1. 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
  2. Start Eggplant Functional and manually add your device to the connection list.