Skip to main content

Using Android Gateway 5.6 and Earlier

Android Gateway works with Eggplant Functional to automate tests on mobile devices running Android 4.1.1 and later. Android Gateway, running on a computer where Android devices are attached via USB, helps make the connection between the device and Eggplant Functional. After you establish a connection, you can use Eggplant Functional to write scripts and create and perform tests against your Android environments.


The information on this page is for Android Gateway 5.6 and older. If you use Android Gateway 6.0 or later, see Using Android Gateway.

Your can use Eggplant Functional to make connections to Android devices that are attached by USB to the same machine that is running Eggplant Functional, in which case Android Gateway is not required. However, using Android Gateway provides additional control over the device and the connection. If you want to make a connection to an Android device that is attached to a remote computer, you will need to have Android Gateway running on the remote computer.

Step by Step: Connecting to Devices with Android Gateway

Follow these steps to use Android Gateway to create a connection between Eggplant Functional and an Android device:

  1. Launch Android Gateway.

  2. Attach an Android device via USB to the machine where Android Gateway is running. When Android Gateway detects the device, you'll see the Status message change from No Android device detected to Ready to start service.

  3. Make sure the device is selected in the device list. If you have multiple Android devices connected to the machine running Android Gateway, each of them shows in the table view, so be sure you select the correct device. The list shows the model number of the detected device (as shown in the device's Settings) and the device serial number, as well as the current connection port and status for the device.

    Select the device you want to connect to in the devices list section of Android Gateway Select the device you want to connect to from the device list section of the screen

  4. (Optional) If you want Eggplant Functional to require a password for connecting to this device, enter it in the Password field in the VNC section of the Settings sidebar. You'll need to enter the same password in the Connection List in Eggplant Functional. Adjust any other settings on the Settings sidebar as necessary for your environment and intended connection. See Android Gateway Settings for information about these settings.

  5. Click Start to start the VNC service on the connected device. When the VNC service is running, the Status message turns green and displays the IP address and port you need to use to connect to the device. However, see Other Connection Considerations below for special connection circumstances.

  6. In Eggplant Functional, create a Connection List item for the Android device. See Using the Eggplant Functional Connection List for more information.

  7. Use the Connection List in Eggplant Functional to open the connection to your Android device.

When you've established a connection, the Eggplant Functional Viewer window displays the Android device screen. You can now capture images on the device and write scripts in Eggplant Functional, using the Android device as you would any other system under test (SUT).

Simultaneous Connections

You can connect to multiple Android devices simultaneously by following the above steps, but you would choose a different device from the list of detected devices for subsequent connections. Each simultaneous connection must use a different port, which you set in VNC section of the Settings sidebar. Settings and configuration choices are saved per device.

See Android Gateway Settings to learn how to configure settings.

Other Connection Considerations

Remember that you can make connections with Android Gateway both from your local machine to a locally attached device as well as to a remote machine that has or devices attached. The instructions above work for making both types of connections. To make a remote connection, you must ensure that Eggplant Functional is able to reach the IP address where Android Gateway is running.

If you're making a connection to a device attached to your local machine, you can set Android Gateway so that it makes the device available only from that machine. To make this setting, go to the VNC section of the Settings sidebar in Android Gateway and set the External port and Local port to the same port number. Note that you can change settings only if the VNC service is not currently running.

Thereafter, when you start the VNC service, the connection information displayed in the Status field shows the localhost IP address,, and whichever port number you used in Settings. Use these numbers when you create your connection in Eggplant Functional.