Android logs
Print logs in real time
Status information log
ANR Log Application Not responding
Monkey Log
Print logs in real time
ADB logcat-b main-v time> app.log Print Application log
ADB logcat-v time> app.log default main
ADB logcat-b radio-v time> radio.log Print RF-related log
ADB logcat-b events-v time > Event.log Print system event logs, such as touch-screen events
Other real-time print logs: Tcpdump, QXDM, etc.
Logcat
Android provides its own log output api--> located in Android.util.
Log in this class. This class is more commonly used to print the log method has 5, these 5 methods will print the log to Logcat: LOG.V (tag,message); Verbose mode, print the most detailed log
LOG.D (Tag,message); Debug-level logs
LOG.I (Tag,message); Log at info level
LOG.W (Tag,message); Warn-level logs
LOG.E (Tag,message); Log at error level
Tag is used to mark the source of the log message. And the message is the contents of this log.
Count from the output count of the log, Error,warn,info,debug,verbose, the number from less to many
Status information log
Bugreport (command adb bugreport>bugreport.log).
Bugreport records the log of the Android boot process, as well as the system status after startup, including the process list, memory information, VM information, etc. it contains DMESG, dumpstate and Dumpsys;
DMESG (command adb shell DMESG > Ldmesg_kernel.log) is kernel log, which is related to kernel, such as driver problem (camera, Bluetooth, USB, boot, etc.)
Dumpstate is the System state information, which is more complete, including the current memory information of the mobile phone, CPU information, Logcat cache, kernel cache and so on;
Dumpsys This is about all the processes in the system.
Status information log
ADB shell Dumpsys meminfo system is to view the memory information of the system process
Dumpsys [Options]
Meminfo Display Memory Information
Cpuinfo Displaying CPU information
Account Displays accounts information
Activity shows all the activities information.
window shows the keyboard, Windows, and their relationships
WiFi Display WiFi information
Anr--application Not Responding
ANR definition: On Android, if your application has been unresponsive for some time, a dialog box is displayed to the user called the application unresponsive (anr:application not responding) dialog box. The user can select wait to keep the program running, or force close. So a smooth and reasonable application can not appear in the ANR, and let the user each time to deal with this dialog box. Therefore, it is important to design the response performance in the program so that the system does not show the ANR to the user.
ANR Log path:/data/anr/traces.txt
ADB command
1. ADB devices
2. ADB install xxx.apk
3. ADB Pull
4. ADB push
5. ADB shell
6. ADB kill-server
7. ADB start-server
8. ADB remount re-mount the system partition to make the system partition writable
9. ADB Uninstall APK package name
10.ADB Logcat–s
11.ADB Shell am START–N Package Name/package name + class name adb shell "Su-c ' am start-n apk.downloader/.activity. Loginactivity ' "(external licensing mode)
ADB Get-serialno get serial number
ADB Shell AM Command
Am:activity Manager, managing activity, turning process on or off ADB shell am
Start activity:adb shell am start-n com.android.camera/. Camera (Component mode)
Close activity:adb shell am force-stop com.android.camera
/A declaration can perform mathematical operations
ADB Shell PM command
Pm:package Manager, used to perform application installation and query, system permissions, control applications
PM List Packages
PM List permission-groups
PM Uninstall Package Name
ADB logcat Filter Log
Filter adb logcat--help
ADB logcat activitymanager:i *:s
ADB Logcat | Findstr Activitymanager
ADB shell KeyCode Analog key events
ADB shell input KeyEvent X
ADB shell input swipe x1 y1 x2 y2
ADB shell input tap x y
ADB shell input Text ABC
Monkey and Monkeyrunner
The difference between monkey and Monkeyrunner:
Monkey: Random Event Stream
Monkeyrunner: Specific Commands and events
Monkeyrunner is mainly used for functional testing and regression testing.
App Test Summary
Install, uninstall test
Verify the digital signature.
The installation and uninstallation tests are primarily for the APK installation files generated by the compiled source program.
Main Test points:
1. Build apk file can be installed and uninstalled on the real machine;
2.Android mobile phone end of the general installation tools, such as: Pea Pod and 91 assistants and other tools can be installed and uninstall the program properly.
3. Overwrite the installation apk file for error.
Online upgrade testing (OTA)
Can be used normally after upgrade.
Online cross-version upgrades.
Business logic Testing
Business logic test: The main test client business can be completed properly.
Function Point test: The main test is whether the client function points are working properly.
Relevance testing: The main test client and PC-side interaction, after the client processing, the PC side and the client data consistent.
Exception Test-Interrupt test
Interactive testing: The client as a mobile phone characteristics testing, including the situation of 13 kinds of interruptions, calls, to SMS, low battery test, but also pay attention to the mobile phone hardware, such as: Standby, Plug and unplug data lines, headphones and other operations will not affect the client.
Anomaly testing: Mainly includes broken network, power outage, server anomalies, such as the situation, the client can be normal processing, to ensure the correctness of the data. Client Side Performance Testing
Benchmark performance test: mainly through the pressure server side interface and the client in different network environment response speed. The main 258 principles.
Large data volume testing: mainly in a specific environment, the client to update a large number of data at once, the client can be normal processing, divided into three cases:
1. The first time the client is used, it updates a large amount of data;
2. The client in the normal update, update a large number of data;
3. The client has updated a large amount of data again after downloading a lot of data locally on the phone. The so-called "2-5-8 principle", simply stated, is that when the user is able to respond within 2 seconds, the system responds quickly, and when the user responds in 2-5 seconds, the response speed of the system can be felt, and when the user gets a response within 5-8 seconds, the system responds slowly. But it is acceptable, and when the user is still unable to respond after more than 8 seconds, the system sucks, or thinks the system has lost its response, and chooses to leave the Web site or initiate a second request.
Ease of Use testing
Interface and interactivity test: conforms to the Android Interactive specification, conforms to the user usage habit, the operation is convenient and simple, has the consistency.
Usability testing: User experience is good, user operation is convenient, user error rate is low.
Fit Test-compatibility test
Phone different resolution support: 720P, 1080P and so on.
Different versions of the phone support: Android 7.0, Android 8.0,ios8, IOS9, IOS11 and so on.
Different manufacturers of mobile phone system support: Xiaomi, Huawei, Samsung, Apple and so on.
Different sizes of phone support: 3.5 "to 5.5", even flat size.
Power and Flow test
Mobile phone power and flow testing is mainly to stand in the user's perspective, after all, the power consumption, the flow rate is larger, will affect the customer's use of feelings. The battery usage rate is proportional to the CPU usage. As this has no more detailed provisions, can only give a general scope, the CPU usage can not exceed 10%, the traffic should not exceed more than 10M. Data can generally be obtained through some monitoring software on the Android phone side. Recommended three mobile phone monitoring software: Emmagee, GT, TREPN Profiler
Memory Leak test
Android's memory mechanism
Android programs are written in the Java language, so Android's memory management is similar to Java's memory management. The programmer allocates memory for the object through new, and all objects allocate space within the Java heap, while the object's release is done by the garbage collector.
Android virtual machine is a register-based Dalvik, its maximum heap size is generally 16M, and some machines are 24M. So the amount of memory space we can use is limited. If our memory footprint exceeds a certain level, it will appear
OutOfMemory's error. A memory leak can occur if a long-term reference resource is not released
External network and scene test
Outside the network test is the reality of the simulation of customers using the network environment, verify that the client program in the actual network environment and the use of dedicated business operations.
Outside the network test mainly covers to Wifi\2g\3g\4g\, Net\wap, telecom \ Mobile \ Unicom, all possible combinations are tested. Principle:
1. As far as possible to cover the user's usage scene, the test case needs to include different network permutations and combinations of possibilities;
2. Also when the analog signal is blocked, the client's influence and so on.
3. Also do external scene testing, in high mountains, hills, trains and other special circumstances to conduct a comprehensive test.
Mobile Interconnect Testing