I. ADB command
1. First install the JDK,SDK, through the cmd input java-v verify the JDK is installed, enter the ADB to verify whether the JDK is installed;
2. Turn on the Android phone in developer mode, turn on USB debugging, link through the data line first, cmd input adb devices, appear as (xxxxxx devices) on behalf of link success,
3, install apk file via adb command (adb install path + file), seccress indicates successful installation
4. Specify to install APK in an app (adb-s xxxxx install APK file)
5. Start service use: adb start-server, stop service: ADB kill-server
6. View log: adb logcat, there are four levels, v,d,i, w,e,f,s generally see the D level: adb logcat *:D
7. Quit ADB shell with exit
Two. Monkey use, by setting the number of clicks detection
1. Two ways to get the apk file's PackageName
1.1 Using the AAPT tool, copy the toolkit to the tools directory of the SDK, run in cmd (aapt dump badging apk file), and the red box indicates the APK file to be queried PackageName
The Red box indicates
1.2, using (adb shell "Logcat | grep START ") command, after running the command, click on the phone need to get PackageName icon, the first red box is to get the PackageName, the second red box represents Activityanme
2.anr:application no response abbreviation, application software is unresponsive
Three. Monkey
1.ADB Shell Monkey 100:100 operations on the phone, need to specify app in actual operation
2.ADB Shell monkey-p PackageName 1000: Indicates that 1000 click events are performed in the specified PackageName
3.ADB Shell monkey-p packagename--throttle 500 100:100 Click Time in the specified packageanme, each time interval is five (--throttle 500) milliseconds
4,ADB Shell monkey-p packagename-v--throttle 500 100: Performs 100 click time in the specified packageanme, each time interval is 500 milliseconds, and is displayed in the first level log (-V). A-V indicates a first-level log, two-V for a level two log, and three-V for a three-level log, which can be replaced
5.ADB Shell monkey-p packagename-v--pct-touch--throttle 500 100: Specify Touch Event Percentage:--pct-touch 50 (note percent, easy to forget write)
Specify percentage of active events:--pct-motion 50:adb Shell Monkey packagename-v--pct-motion 500 100
Specify the percentage of trackball events:--pct-trackball 70
Specify the percentage of navigation events:--pct-nav 30
Specify the percentage of primary navigation events:--pct-majornav 50
Specify the System key event percentage:--pct-syskeys 50
6. Common commands: adb shell monkey-p packagename--throttle--ignore-crashes--ignore-timeouts--ignore-security-exceptions-- Ignore-native-crashes--monitor-native-crashes-v-v-v 1000000 > C:\monkey_test.log
--ignore-crashes: Ignore crash; Ignore-timeouts: Ignore timeout;--ignore-security-exceptions: Ignore security exception;--ignore-native-crashes: Ignore local crash; --monitor-native-crasher: Ignore detection Tool local crash
Use-S in 7.-s:monkey. As long as the command is the same, the running trajectory is consistent, adb shell monkey-p packagename-s 500-v 100, and then run the command at different times, the same running trajectory (easy to reproduce the problem)
8. When the log file is large, it is generally redirected to a file, search (ANR), notice the need to add a space, crash,exception,error, and there is no exception information before and after the first switch
9.seed value: The value in the command after-S is the seed value, and if not written, the system automatically generates a
Phone test related