Airtest Project (1) - way multiple connected devices

airtest multiple connected devices


 

A, USB connection

  Android device via USB connection is simple, divided into two cases:

  1. Run the script AirtestIDE

    Enter developer mode, turn on USB debugging Android devices, the IDE connector panel at the top right of the mobile device will appear under the map, click connect, you can wait for the device interface.

    

  2. Run the scripts in the CMD

    Open the CMD, enter the same developer mode, turn on USB debugging Android device, enter the following command:

1 airtest RUN " absolute path to the folder of your .air " --device Android: // 127.0.0.1 (your PC IP): 5037 (port)   / c5bd090eddd (serialno)

    In the test script does not need to write a script connected devices, such as

1 dev = connect_device('Android://127.0.0.1:5037/c5bd090eddd')

 

Second, the wireless connection

  If you do not want to even USB, you can use a wireless connection, the same two ways. The first is to control the phone in Airtest of the IDE; the second is the command line to run the script so that remote control handset. But these two methods before you start, you need to do the following operations:

  (1) your device is connected to your PC via USB;

  (2) open adb port on the phone;

      Execute the following command in CMD inside:

TCPIP the adb 48 887 (free of any port number)

      Which port number 48887 you can set their own port number for the other, but can not conflict with existing port. After the command is complete, you can unplug the USB cable.

  (3) Check your IP devices.

    Then there is the remote control handset.

  1. Run the script AirtestIDE

    Open the IDE, the next operation is shown, in which you can find IP phone wireless router can also be found in the phone system settings. Port is the port on a command set.

    

    Click on the link, wait for the next map interface appears, click connect, wait for the phone screen to appear.

    

  2. Run the scripts in the CMD

  First of all, in your test script add the following code:

1  # connection device 
2 dev = connect_device ( ' Android: ///10.103.214.14 (phone IP):? 48887 (port number) cap_method = javacap & touch_method adb = ' )

  Then, open the CMD, enter the following command:

1 airtest RUN " absolute path to the folder of your .air "   # Note that the back does not need to plus --device ...

  Success will start running your test scripts, wireless connectivity devices. Note that the first connection may need to install Yosemite.apk.

 

 

    

  

Guess you like

Origin www.cnblogs.com/NanaseHaruka/p/11098891.html