Skip to main content

Android Devices

The Eggplant Gateway for Android runs on Windows, Linux and macOS machines and supports testing on real, physical Android devices over Wi-Fi and USB.

Enabling automation on your Android device

  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 pannel.
    • 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 popup Allow USB Debugging will appear on your device, tap Always allow from this computer and tap OK.
  4. In order to allow the SetDeviceLocation command to work when necessary, you will need to enable Mock Location on your Android device.
    • Go to Settings > Developer Options and turn on Mock Locations.

Creating a connection

To create an Eggplant Gateway for Android connection, 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.
    • The 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.