1. View the connection device adb devices2, clear data adb shell pm clear com.wuba3, install the APKADB install path how to determine the package name of the app under test: ADB logcat |findstr start to launch the app under test, The information between CMP and backslash/in log is package name 4, adb shell Monkey How to suppress system events (0 is System time percentage) adb shell monkey-p Com.wuba--pct-syskeys 0-v 1005, adb logcatadb gets activity on the current pageMethod one: adb logcat | Findstr displayed method Two: Enter adb shell to execute dumpsys window |grep-e ' Com.wuba ' adb logcat main functionsLogcat(four types of log buffer are main,radio,system,events)adb logcat-v time > Logcat.txt//default is-B main-b systemadb logcat-v time-b main//main logadb logcat-v time-b Radio //radio log adb logcat-v time-b system//system Logadb logcat-v time-b Events6. ADB Shell DumpsysADB Determines whether the device is locked and black screen statusadb shell Dumpsys window policy|findstr mscreenonfully If true, that is, the lit state is false, that is, the black screen State other features adb shell Dumpsys Activity---------------View Actvitymanagerservice All information adb shell Dumpsys activity Activities----------View activity component information adb Shell Dumpsys Activity Services-----------View service component information adb shell Dumpsys activity Providers----------production See ContentProvider component information adb shell Dumpsys activity broadcasts--------view braodcastreceiver information adb shell Dumpsys activity Intents--------------View intent information adb shell Dumpsys activity Processes---------View process information7. ADB shell AMam (Activitymanager)Response Time Test (the actual app test cannot be judged as a criterion)ADB shell am start-w com.wuba/.home.activity.homeactivityadb Shell am start-w com.wuba/.activity.launch.launchactivity
- If you only care about the startup time of an application, Refer to TotalTime;
- If you are concerned about the time-consuming system startup application, refer to waittime;
- If you care about the application having an interface activity start time, Refer to Thistime.
8.How to Stop monkeyadb ShellPS | grep monkeyThe first number returned, which is the process number of the monkeyShell 7772 185 277516 22244 ffffffff 4010a58c S com.Android. Commands.monkey The kill command ends the process to continue typing:kill 7772[The process number just found 10. adb Shell Monkey--ignore-crashes ignore the application crash error, do not specify this parameter, the application appears crash,monkey automatically stop sending the event, after specifying the parameter, Mongkey will also send the event after crash, Knowing that all events are sent to completion--ignore-timeouts ignores the error caused by the timeout, that is, the ANR error--ignore-security-exceptions ignoring the rights error--monitor-native-crashes monitoring by C/ C + + code-induced crash--ignore-native-crashes ignores crash--kill-process-after-error that are caused by C + + code when an error occurs after you kill the app's process--hprof specify this option, Monkey will generate a performance report after the Send event is completed, the report is generally stored in the/data/misc directory 11, view permissions AAPT dump badging apk Path (View APK Package's PackageName, Versioncode, Applicationlabel, launcheractivity, permission and more)12. Test the app for excessive power consumptionadb shell logcat-v timethe sending alarm line in the export log does not contain the application package name to be tested. If present, it is necessary to pay attention to whether the type 0 and 2 sending alarm is frequent, if more than once, it is possible to cause excessive power consumption. 13. After connecting the phone via the TCP command, you can send the command after the phone and PC are disconnected:first Wake server,adb Start-server via USB cable, then perform adb tcpip 5555, reset port number: 5555, after finding the phone IP, execute the ADB connect IP, after successful connection can disconnect the phone, execute adb-s 10.252.221.202:5555 Shell Monkey-p com.wuba-v and other related tasks Supplement:Server and client communication port 5037, ADB server will interact with emulator, use two ports, one is 5554 dedicated to emulator instance connection, Then the data can be forwarded from emulator to the IDE console, and the other is 5555, specifically with ADB daemon connection for back debugging use 14. ADB Shell PS after executing adb shell PS user PID PPID vsize RSS wchan PC namefu0_a349 31658 481 2405608 180692 FFFFFFFF 00000000 SU SER: The current user of the process; PID: There is no doubt that the abbreviation for process ID is also the ppid:process parent ID, the parent process idvsize:virtual size, the process virtual address space size; RSS: The physics in use by the process Wchan: The address in the kernel if the process is dormant, the name of the Pc:program counter,name:process name, the processFAQ1. ADB server didn ' t ACKSolution:First execute ADB nodaemon server get port numberNext Execute Netstat-ano |findstr "5037" to get the PID 8516 of the occupied portfinally execute taskkill/f/pid 8516
ADB command accumulation (continuous update)