Recently, I have seen atX, Appium and Vysor in the android phone group control system. Their principle is to start an HTTP server on the mobile end to receive script commands and invoke UIautomator to perform interface operations. Uiautomator can refer to official documents If you want to execute uiautomator in the server, you’ll be prompted

No instrumentation registered! Must run under a registered test

Run in the official document demo uiautomator test cases can be executed as the beginning of the test cases under the environment of server can perform the test script command can refer to https://blog.csdn.net/Liu_Liu…

  1. Servers can be found off-the-shelf such as Open source server provided by Vysor
  2. Write the code to start the server in the project’s test case
  3. For instrumentation

    The adb shell PM list return to instrumentation instrumentation: package name. The test/androidx test. The runner. AndroidJUnitRunner
  4. Starting the server

    The adb shell am instrument - w package name. The test/androidx test. The runner. AndroidJUnitRunner

This can be accessed from within the LAN and calls the interface to perform uiautomator operations