The operation is done under Windows and can be connected to the physical phone or simulator after the Android SDK is installed.
1. View connected phone or simulator
ADB devices
The results are as follows:
2. Check the package name and activity of an app
ADB logcat|find "Start" (adb logcat|grep start if under Linux or Apple computers)
The results are as follows:
The com.meizu.flyme.calculator behind the CMP is the name of the mobile phone's calculator package, and the. Calculator for its corresponding activity
3. Launch the App
ADB shell am start-w-N package/activity
Here is an example of a calculator:
Thistime is time-consuming for this startup
The app launch test is actually compared to other similar apps and the previous version of the app, is the startup time getting longer? Is there any possibility of optimization?
4. Close the app (cold start)
ADB Shell AM force-stop Package
Here is an example of a calculator:
5. Close the app (hot start)
ADB shell Input KeyEvent 3
The results of the implementation are as follows:
This way off, in fact, the app is transferred to the background, the start of the time in the foreground display, boot time is certainly faster than cold start
6. CPU Usage in app usage
ADB shell Dumpsys cpuinfo|find "Com.meizu.flyme.calculator"
The results of the implementation are as follows:
This app is used in the previous situation
7. App usage Data traffic situation
adb shell ps|find "com.meizu.flyme.calculator"---this will get the app's process ID (ie PID)
adb shell cat/proc/$pid/net/dev---using PID to get traffic usage
Implementation is as follows:
The inside of the LO network port traffic is local traffic does not need statistics
8. Check the battery status
adb shell Dumpsys Battery
Implementation is as follows:
The current charge is in the red box
The test is meant to use the usage of the app and compare it with other/previous versions
9. Change the phone to non-charging status
adb shell Dumpsys Battery status Set 1
The results of the implementation are as follows:
Some commands for app operation