Connecting mobile devices

Mobile devices can be connected either locally using USB cable or remotely by providing device IP address and its port. AirtestIDE supports both methods. In addition, AirtestIDE also supports to connect and operate several devices at once.

Combination of locally and remotely connected devices are supported as well.

When connecting the device to AirtestIDE, make sure that Device Window is selected in Window menu and it is Mobile Phone Connection section is visible on the right side of AirtestIDE GUI layout.

../_images/device_window1.png ../_images/mobile_phone_conn1.png

Connecting device via USB

Following steps describes how to connect the device locally using a USB cable. Before you connect your device, make sure to review Before you start section.

  1. connect the phone to a computer using a USB cable
  2. if you are using Windows OS on your computer, make sure the device driver is installed properly
  3. click Refresh ADB button to display the connected devices in the devices list table
  4. when the device is ready to connect (Adb status is “device”), click Connect button and the content of the device screen will appear

Connecting remote device

Following steps describes how to connect the remote device.

  1. get the information about the remote device - its IP address and port
  2. input adb connect ip:port into remote device field and click Connect button in the remote connection area
  3. the device will appear in the device list table, to connect the device, click Connect button
  4. if the mobile device still does not appear in the device, please review the Solving problem with connecting the mobile devices section below.

Solving problem with connecting the mobile devices

If the mobile device still does not appear in the devices list, try to click Restart ADB and then Refresh ADB again. If the difficulties persist, open the command line and run:

$ adb devices
List of devices attached
FA69J0305903    device
0a33789f        device

If the device is listed when executing command above but it does not appear in the IDE, see the FAQs <../3_faq/android_connection_new.html> and try to solve the problem.

Android mobile assistant (trial)

In order to facilitate the use of Android mobile phone users to do some ADB related operations, we have added an Android mobile phone assistant function, ** after connected to the phone **, click the tool icon in the upper right corner of the device window, in the expand drop-down menu, select Show assistant dialog to open the Android Phone Assistant.

../_images/assistant_entry.png ../_images/android_assistant.png

In the Android Phone Assistant, we offer the following features:

  • Install/uninstall/list view of mobile app
  • Common shortcuts: open URL, enter text, switch input method, volume adjustment, etc.
  • Mobile phone shell debugging window


Currently, the Android mobile assistant function is still in the test stage. If there is a bug, please send the operation steps, phone model, Android version number and error log to Github .

1. App management function

Install Apk from your computer to your phone

At present, you can directly click the install button on the Android assistant and select the apk file on the PC to open the installation window. Clicking on the Install button will start trying to install apk on your phone. Please note that you need to click in the phone to agree to the installation.


In addition, you can also directly drag the apk file to the screen of the current mobile phone and release the mouse button to open the installation window.

Mobile app list view

The list of apps installed currently on the phone is displayed on the left side of the Android assistant. You can enter keywords in the search box to filter the list. Checking Only show third party applications will only show third-party apps on your phone, making the list more streamlined.


Mobile phone application shortcuts

In the lower right corner of the Android assistant is a series of shortcut buttons for mobile applications, which can be used to start, close, uninstall, clean and backup the selected applications in the left list.


Before clicking the operation stop start clear, make sure that the package name displayed in the current Package column is the corresponding package name you want to operate. Click the refresh button to refresh and display the package information in the phone’s current startup.

2. Mobile phone shortcuts

Open URL and quick input

Enter the URL in the upper right corner of the input box and click open to open the URL using your current default browser. Enter the text and click input to enter it on your phone.

Fast switching input method

In the IME Manager drop-down menu, you can quickly switch the current input method of the phone. The default input method used in airtest is the yosemite input method, which is not convenient when switching back to manual use. Now you can directly switch input method in this drop-down menu.


Common shortcuts

The Quick Button provides the unlock button, power button , and a snapshot button that immediately captures a picture of the current phone screen and saves the path to the computer.

Volume Setting provides shortcuts for mute , volumn_down , and volumn_up operation.

3. Mobile phone shell debugging window

Occasionally we need to do some ADB operations on the Android phone, or connect to the ADB shell to view some information related to the phone. Currently, you can switch to the Remote Debug page in the Android mobile assistant, you can directly enter the adb shell command.


As shown in the figure, you don’t need to enter adb shell, only need to input the subsequent instructions, you can see the corresponding return result.

The Clear log button clears the log in the current window. Export log to a file can export the information in the current log window to a text file.

Please Do not enter some commands such as top, since it will enter repeatedly the refresh command.

Connecting Windows in Windows OS

AirtestIDE also supports to embed the windows when using Windows operating system. Currently, there are supported two methods - select window by mouse and select the window from given list of available windows.

How do I embed a window using the mouse?

Following steps describes how to embed window into AirtestIDE using the mouse.

  1. click Select Window button to enter the window selection mode
  2. as the mouse moves, there is a green border-box marking the currently selected window
  3. place the green border-box on the target window and click left mouse button to complete the window embedding

Solving troubles with embedding the windows

If you are unable to embed the window, check the Windows embed backup method settings in “Settings” - “Options” - “Device”and then try again.