Skip to content

2.3 Android emulator connection

If we don't have an Android real machine available and want to have automated testing for Android app, then we need to use the Android emulator automated testing function of AirtestIDE .

The simulators supported by AirtestIDE include Android Virtual Device (AVD) and common simulators on the market (such as Mumu Simulator ).

The emulator can be connected to AirtestIDE like a real machine. If the screen is black, please check the Use javacap option in the drop-down menu of the connect button before connecting the emulator, then click the connect button to connect.If the connection still fails, you can try to check the connection after selecting use adb orientation.

1. Emulator connection

Here is an example of a simulator, showing the connection process of the simulator:

  • First, like phones, you need to open the developer option -allowing USB debugging of the emulator.Some simulators may need to find Settings - About Phones and click on it multiple times to open the developer options:


  • Open the Remote Device Connection in the AirtestIDE device window and enter adb connect (this port number is related to the simulator brand, see 2. Simulator Connection Port Summary).Then click the Connect button.


  • The device can be seen in the device list. Click the drop-down menu next to the Connect button, check the Javacap mode, and then click the Conenct button(If you do not check the Javacap mode, it will cause that the screen of the phone is black.).If you still can't connect successfully, you can check the use adb orientation and connect again.


  • Complete the connection:


2. Simulator connection port summary

The device connection code for the mainstream simulator is as follows:

simulator adb connection code
Netease Mumu adb connect
night God adb connect
xiaoyao adb connect
iTools adb connect
tiantian adb connect
tianmawan adb connect
BlueStacks adb connect

For the connection process of these simulators, refer to the description above 1. Simulator connection.

3. Android Native Simulator (AVD)

  • Install the Android environment:

    Build Android Studio and when finished, select Tools > Android > AVD Manager in Android Studio.

  • Create a simulator:

    • Create a device interface:
    • Select device:
    • Select system:
    • The configuration page is filled in as follows:
    • After the device is created, start the virtual device:
  • Connect the simulator:

    • The emulator-555x device will appear in the AirtestIDE device window, click on the Conenct button:
    • Complete the connection:
  • When connecting to the emulator, you need to check the use javacap option and then click the connect button to connect to avoid the black screen.

  • On some versions of the emulator, the connection may still fail after checking use javacap option.At this point, you can try to check the use adb orientation option and then reconnect.

  • Since the above options need to be checked when connecting the emulator, if you are connecting the emulator, you also need to pass these parameters to the running script when running the script. For details, please refer to Running the script using the command line.

  • Some brands of simulators may not be able to click properly. You can try to check the use ADBtouch and then connect.

  • Some brands of emulators (such as the Night God) may use keyboard input by default, so the yosemite input method cannot be called, resulting in the inability to enter text using the text() interface.You can confirm whether the Hardware-Physical Keyboard is checked in the emulator settings, uncheck it and try again.


If it still fails (the physical keyboard option is automatically reset), you can open the simulator settings in the upper right corner, check the soft keyboard option and try again:


If you still can't input, you can consider switching to poco to input, or directly input the English content using the adb command. For details, see Documentation.