1.appium Working principle
On the Android side, Appium is based on the Webdriver protocol, using Bootstrap.jar, and finally using uiautomator commands to automate the app's testing.
The Uiautomator test framework is an app UI Automation test Java library that comes with the Android SDK.
In addition, thanks to Uiautomator's limited support for H5, Appium introduced Chromedriver and safaridriver to implement H5-based automation.
Appium on Android side workflow
The client side, which is our test script, is our webdriver.
In the middle is the Appium service, Appium a server (4723 port) on the service side, similar to the Selenium webdriver test framework, Appium the standard webdriver jsonwireprotocol. Provided here it provides a set of rest interfaces, Appium server receives the Web driver client standard rest request, parses the request content, and responds to the action with the corresponding framework.
Appium server forwards the request to the middleware Bootstrap.jar, which is written in Java and installed on the phone. Bootstrap listens to port 4724 and receives Appium commands, which are finally implemented with Uiautomator commands.
Finally, Bootstrap returns the results of the execution to Appium server.
Appium server then returns the result to the Appium client.
2. How to start Appium
(1) Booting via client
(2) Start by command
Appium-a 127.0.0.1-p 4723--session-override
-A is the specified listening IP (can also be written as--address), the back "127.0.0.1" can be changed to the IP address you need;
- p is the port that specifies the listener (which can also be written as--port), or it can be modified to the port you need;
--session-override refers to the previous session covered;
Appium working principle and starting mode