1. Install appium client
appium client webdriver native api is some expansion and packaging. It helps us use cases easier to write, write better use cases.
appium client with native webdriver is used, and therefore both must be used, indispensable.
We use pip install "Appium-Python-Client".
Pip-python-client install epochs
2. adb command
Works of 2.1 adb
The concept of 2.1.1 adb
ADB full name of the Android Debug Bridge, is a debugging tool.
Android programmers to develop applications that must be masteredTest engineers do Android application testing, will be used to
2.1.2 adb's structure and working principle
adb composition:
- client side: on the computer responsible for sending adb command.
- daemon daemon: on the phone, is responsible for receiving and executing adb command.
- server-side: on a computer, is responsible for managing communication between the terminal and the actual Client Daemon.
adb works:
- the client side sends the command to the server side
- command to the server daemon will end side
- daemon end execution
- The execution result is returned to the terminal server
- The back end server client-side configuration
2.2 adb commonly used commands
2.2.1 obtain the package name and interface name
Package name (package): decision uniqueness (not the name of the application) program.
Interface names (activity): corresponds to an application's interface, also called the start name.
Automated tests need to tell which application program interface which tested the phone in the form of code, it needs to get through this command.
Format:
adb shell dumpsys window windows | findstr mFocusedApp
The results are as follows:
Where the package name:
com.tencent.mobileqq
Interface named:
.activity.FriendProfileCardActivity
2.2.2 File Transfer
(1) send the file to the phone
Data (database files) will need to adjust the phone on the computer, sent directly to your phone.
Format:
adb push a computer file path phone folder path
Example:
Will be sent to the phone's desktop a.txt sd card
adb push C:\Users\ACER\Desktop\a.txt /sdcard
operation result:
This represents the successful, but I'm too lazy to go to the phone screenshots sent to the computer.
(2) pull the file from the phone
Pull files (database files, log) generated by mobile phones get into your computer.
Format:
adb pull the phone's file path computer folder path
Example:
The a.txt phone's sd card is pulled to the desktop
adb pull /sdcard/a.txt C:\Users\ACER\Desktop\
operation result:
2.2.3 Gets app startup time
If an enterprise has the speed required to start the application, you need to use this command for testing.
Format:
adb shell am start -w package name / name start
Example:
Com.android.settings program starts and the main interface (.Settings)
adb shell am start -W com.android.settings/.Settings
operation result:
ThisTime: The interface (Activity) Start Time Lag (ms)
TotalTime: Application of its own promoter Processed = ThisTime + applications and other resources application start time (ms)
waitTime: boot = application time-consuming system resources, start-up time (ms)
2.3 adb command Daquan
I saw a big brother to write CSDN blog, but I do not know how cross-site reproduced, so be it.
"Adb command Daquan": https://blog.csdn.net/duoluo9/article/details/79791988