Android app log analysis test of Money

Turn: Original: https: //blog.csdn.net/a136332462/article/details/76066909 

A general analysis of test results - Keyword Search:

1, no response problems can search for "ANR" in the log.

2, crashes search "CRASH".

3, memory leaks search "GC" (require further analysis).

4, abnormal question Search "Exception" (if null pointer appears, NullPointerException, need extra attention).

Detailed description

1, ANR problem: search the log "ANR" ( "Application Not Responding "), there is described bug, the ANR appears, in response to the main thread is typically more than 5 seconds, or BroadcastReceiver does not respond within 10 seconds. This is a serious flaw. The time-consuming operations from other threads to handle it.
2, crash: in search logs "Exception"


Second, a detailed analysis of monkey log:
The execution log generated Monkey derived from the phone and open to view the log; showing package name seed values Monkey execution, execution times and will be tested at the beginning of the log.
First, we need to test to see if there is a Monkey ANR or abnormal, the specific method as described above. Then we have to analyze the specific information in the log, as follows:
View log in the first Switch, mainly to see Monkey do is that one Activity, for example, the following log, the execution is com.tencent.smtt.SplashActivity, next , if there is a crash or other abnormalities, can be found in the Activity in question between a swtich lies.


:Switch:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10000000;component=com.tencent.smtt/.SplashActivity;end 
// Allowing start of Intent {act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER]cmp=com.tencent.smtt/.SplashActivity } in package com.tencent.smtt


In the following log in, Sending Pointer ACTION_DOWN and Sending Pointer is currently performed an operation on behalf of ACTION_UP a click;
Sleeping for 500 milliseconds sentence log interval is the time when performing Monkey tests, throttle setting, each appeared once on behalf of a event.


SendKey (ACTION_DOWN) // KEYCODE_DPAD_DOWN currently executing on behalf of a click operation of the navigation key;
Sending the Pointer ACTION_MOVE representing the current operation has been performed a sliding interface.
: Sending the Pointer ACTION_DOWN = 438.0 X = 47.0 Y
: Sending the Pointer ACTION_UP X = 47.0 Y = 500 milliseconds for 438.0Sleeping
: SendKey (ACTION_DOWN): // KEYCODE_DPAD_DOWN 20 is: SendKey (ACTION_UP): // KEYCODE_DPAD_DOWNSleeping 20 is 500 milliseconds for
: Sending the Pointer X = Y = -2.0 ACTION_MOVE 3.0
: Sending the Pointer ACTION_MOVE X = 4.0 Y = -3.0
: Sending the Pointer ACTION_MOVE X = Y = -5.0 -3.0
: Sending the Pointer ACTION_MOVE X = 3.0 Y = 4.0
: Sending the Pointer ACTION_MOVE X Y = -4.0 1.0 =
: Sending the Pointer ACTION_MOVE X = Y = -1.0 -1.0
: Sending the Pointer ACTION_MOVE X = Y = -4.0 -2.0


If the test is successful Monkey execution is complete, the log of the last, will print out the number of the currently executing event and the time it takes; // representatives Monkey finished execution is complete. Monkey execute the interrupt, the last log can also view the number of the currently executed. Monkey completion of the execution log as follows:
Events Injected: 6000
: the Dropped: Keys = 0. 9 trackballs Pointers = 0 = 0 = flips
## the Network stats: Elapsed Time = 808384ms (Mobile 0ms, 808384ms WiFi, 0msnot Connected)
// Finished Monkey
Third, the specific analysis of common problems
1, null pointer exception
null-pointer exceptions mainly have a NullPointerException tips, Monkey in the testing process, the information is typically recorded in plog.log (locat also has the information) in.
If the command is interrupted Monkey, indicating abnormal information and a corresponding print information, you can see the message below, a few questions:
A, android.process.acore the process abnormal
B, mainly due to NullPointerException exception information caused, that is, the emergence of a null pointer, led acore process into the Debug
C, the specific analysis can continue to function by which the line leads, as can be from rollAnimate3dRotate.java file 275 lines look like.
AT com.android.launcher.LauncherAnimator.ScrollAnimate3dRotate.drawFrame // (ScrollAnimate3dRotate.java:275)
D, there may be a null pointer exception many of the same application, it refers to the abnormal event of an empty, log information can be analyzed and compared, If not, then the new log information needs to be added together to the bug, if the log information has been, then you do not need to continue to add log information is not necessary.
************************************************** ************************
// CRASH: android.process.acore (pid 1339)
// Short Msg: java.lang.NullPointerException
// Long msg: java.lang.NullPointerException
// the Build the Label: Android: FIH / msm7627_surf / msm7627_surf / F0X: 1.6 / DONUT / 0001_0_020: E
ng / Release-Keys
// the Build Changelist: -1
// the Build Time: 1271397239
// ID :
// Tag: android runtime
// java.lang.NullPointerException:
//   at com.android.launcher.LauncherAnimator.ScrollAnimate3dRotate.drawFrame(ScrollAnimate3dRotate.java:275)
//   at com.android.launcher.Workspace.dispatchDraw(Workspace.java:605)
//   at android.view.ViewGroup.drawChild(ViewGroup.java:1524)
//   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
//   at com.android.launcher.DragLayer.dispatchDraw(DragLayer.java:258)
//   at android.view.ViewGroup.drawChild(ViewGroup.java:1524)
//   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
//   at android.view.View.draw(View.java:6329)
//   at android.widget.FrameLayout.draw(FrameLayout.java:352)
//   at android.view.ViewGroup.drawChild(ViewGroup.java:1526)
//   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
//   at android.view.View.draw(View.java:6329)
//   at android.widget.FrameLayout.draw(FrameLayout.java:352)
//   at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1901)
//   at android.view.ViewRoot.draw(ViewRoot.java:1333)
//   at android.view.ViewRoot.performTraversals(ViewRoot.java:1098)
//   at android.view.ViewRoot.handleMessage(ViewRoot.java:1618)
//   at android.os.Handler.dispatchMessage(Handler.java:99)
//   at android.os.Looper.loop(Looper.java:123)
//   at android.app.ActivityThread.main(ActivityThread.java:4203)
//   at java.lang.reflect.Method.invokeNative(Method.java:-2)
AT java.lang.reflect.Method.invoke // (Method.java:521)
// AT com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:799)
// AT com.android.internal .os.ZygoteInit.main (ZygoteInit.java:557)
// AT dalvik.system.NativeStart.main (NativeStart.java:-2)
** the Appears to have have the System Event Crashed AT 7908 of the using SEED 5000000 0
2, Debug exception
debug disorders are abnormal because of an error caused by the application itself. Monkey In testing, the same information is recorded in plog.log (locat also has the information therein). In general, the problem occurs, it may also be in the manual test to test.
A, com.android.browser the process into the Debug
B, is emerging IllegalStateException exception, which is generally more abnormal parameters passed illegal or multiple occurrences when called
C, when Bug information submitted detailed information should be included in the general the following log information for easy developer analysis and positioning.
************************************************** **********************
// CRASH: com.android.browser (pid 5683)
// Short Msg: Connection is not open
// Long Msg: java.lang.IllegalStateException: Connection is not open
// Build Label: android:FIH/msm7627_surf/msm7627_surf/F0X:1.6/DONUT/0001_0_020:eng/release-keys
// Build Changelist: -1
// Build Time: 1271397239
// ID:
// Tag: AndroidRuntime
// java.lang.IllegalStateException: Connection is not open
//   at android.net.http.AndroidHttpClientConnection.assertOpen(AndroidHttpClien
tConnection.java:153)
//   at android.net.http.AndroidHttpClientConnection.setSocketTimeout(AndroidHtt
pClientConnection.java:195)
//   at android.net.http.Connection.openHttpConnection(Connection.java:364)
AT android.net.http.Connection.processRequests // (Connection.java:225)
// AT android.net.http.ConnectionThread.run (ConnectionThread.java:116)
** the Appears to have have Crashed System Event AT 34155 of 5000000 the SEED 0 ** a using
3, low-memory exception
in exceptional circumstances generally low memory, mainly in the event of an OutOfMemoryError or prompt Out of memory, the consequences likewise show OutOfMemoryError is thrown, or to kill by kill process part of the process to release memory space, of course, if the kill key point of the process, then it may cause some applications will automatically exit. When this happens, mainly during frequent cause of a large number of operations, it is also possible to use manually perform reproducible.
A, com.android.elastos.backup abnormality occurs in the process of
B, is appearing OutOfMemoryError exception, which generally more frequent operations (ie multiple calls a function, there is not space to apply variable release) caused
C, Bug when submitting information, detailed information should also contain the following log information for easy developer analysis and positioning.
CRASH //: com.android.elastos.backup (pid 1581)
// Short Msg: Bitmap size Exceeds VM at Budget
// Long Msg: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
// Build Label: android:FIH/msm7627_surf/msm7627_surf/F0X:1.6/DONUT/0001_0_020:eng/release-keys
// Build Changelist: -1
// Build Time: 1271397239
// ID:
// Tag: AndroidRuntime
// java.lang.OutOfMemoryError: bitmap size exceeds VM budget
//   at android.graphics.Bitmap.nativeCreate(Bitmap.java:-2)
//   at android.graphics.Bitmap.createBitmap(Bitmap.java:464)
//   at android.graphics.Bitmap.createBitmap(Bitmap.java:431)
//   at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:336)
//   at android.widget.AbsListView.preScaleBitmapBG(AbsListView.java:2354)
//   at android.widget.AbsListView.draw(AbsListView.java:2365)
//   at android.view.ViewGroup.drawChild(ViewGroup.java:1526)
//   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
//   at android.view.View.draw(View.java:6329)
//   at android.view.ViewGroup.drawChild(ViewGroup.java:1526)
//   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
//   at android.view.View.draw(View.java:6329)
//   at android.widget.FrameLayout.draw(FrameLayout.java:352)
//   at android.view.ViewGroup.drawChild(ViewGroup.java:1526)
//   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
//   at android.view.View.draw(View.java:6329)
//   at android.widget.FrameLayout.draw(FrameLayout.java:352)
//   at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1901)
//   at android.view.ViewRoot.draw(ViewRoot.java:1333)
//   at android.view.ViewRoot.performTraversals(ViewRoot.java:1098)
//   at android.view.ViewRoot.handleMessage(ViewRoot.java:1618)
//   at android.os.Handler.dispatchMessage(Handler.java:99)
//   at android.os.Looper.loop(Looper.java:123)
//   at android.app.ActivityThread.main(ActivityThread.java:4203)
//   at java.lang.reflect.Method.invokeNative(Method.java:-2)
//   at java.lang.reflect.Method.invoke(Method.java:521)
//   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
//   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
AT dalvik.system.NativeStart.main // (NativeStart.java:-2)
** System Crashed the Appears to have have a using AT Event 143 290 of the SEED 100000000 # 0
or there is information plog the last occurrence of the following log information may also be the same problems:
<. 3> [56351.640641] Out of Memory: Process the kill 14177 (app_process) Score 247 872 Child or A
<. 3> [56351.641121] Process Killed 14177 (app_process)


4, does not respond abnormal
operation without responding, mainly during Monkey operation occurs a functional unresponsive prompted to "force closing" or "waiting", and it will print out the corresponding log information as follows:
A, com.android.soundrecorder can explain the process appears unresponsive
B, occur when TimerOut exception, which usually occurs usually prompt and keyDispatchingTimedOut
C, at present, uPhone phone often does not respond several modules including: clock , camera, soundrecorder, broser, etc., according to developers analyze other modules are also likely does not respond, the testing process, like him to pay attention.
D, unresponsive abnormal, difficult to be repaired under normal circumstances, and the frequency of the transmission events are also relevant, up from quality requirements, then the requirements minimize operating unresponsive frequency and time appear.
The NOT RESPONDING //: com.android.soundrecorder (pid 1931)
ANR in Process: com.android.soundrecorder (Last in com.android.soundrecorder)
Annotation: keyDispatchingTimedOut
the CPU Usage:
the Load: 8.24 / 8.41 / 8.25
the CPU Usage from 35911ms to ago Member 83ms:
  com.android.soundrecorder:. 3. 4% =% + 0% User Kernel / Faults: 997 Minor 43 is MAJ
or
  mediaserver: 2% = 2% user + 0% kernel / faults: 267 minor 3 major
  android.process.media: 2% = 0% user + 1% kernel / faults: 563 minor 194 major
  system_server: 1% = 1% user + 0% kernel / faults: 1279 minor 5 major
  com.cootek.touchpal: 0% = 0% user + 0% kernel / faults: 180 minor 1 major
  sensorserver_ya: 0% = 0% user + 0% kernel / faults: 47 minor 1 major
  mmcqd: 0% = 0% user + 0% kernel
  app_process: 0% = 0% user + 0% kernel / faults: 203 minor 1 major
  com.fihtdc.brservice: 0% = 0% user + 0% kernel / faults: 29 minor
  kswapd0: 0% = 0% user + 0% kernel
  com.android.settings: 0% = 0% user + 0% kernel / faults: 266 minor
  port-bridge: 0% = 0% user + 0% kernel / faults: 19 minor
  rpcrouter: 0% = 0% user + 0% kernel
  com.android.mms: 0% = 0% user + 0% kernel / faults: 135 minor 8 major
TOTAL: 13% = 8% user + 4% kernel + 0% iowait


procrank:
  PID Vss Rss Pss Uss cmdline
 1209 35368K 25376K 15283K 14036K system_server
 1342 32788K 24596K 14899K 14136K android.process.acore
 ......
// procrank Status WAS 0
ANR traces:
// meminfo Status WAS 0
** System the Appears to have have Crashed AT Event of a using the SEED 0 5000000 59034
5, other anomalies
a, restart system abnormality (system restart), that is, the last few lines of the log will see restart system of print information, indicating that the phone is automatically restarted or broken, there are a few the causes of
a, during operation, the presence of abnormality is automatically restart the phone
2, the mobile phone during operation proceeds to restore factory settings settings, cause the phone to restart
3, for other reasons, if the mobile phone back cover, etc.
B, RuntimeException abnormality such as when the same will be seen in the corresponding print information in plog.log, java.lang.RuntimeException the problem often seen in operation after no response, or an application can not start the service or connection, you need a specific analysis of specific issues
C, StaleDataException, readException abnormality such plog.log can be seen in the corresponding print information, corresponding information will have: android.database.StaleDataException, android database information specifying abnormal operation, specific analysis of specific problem requires
D, IllegalArgumentException other anomalies, how many cases passed as explain to the function of an incorrect or illegal parameters need to analyze specific issues of
E, the other with supplementary explanation and analysis

A couple of points:
1, log analysis of information, hope briefly bug information that can clearly explain what it clearly showed that the abnormal and specific log information to be added separately to the information described in detail, making it easy to locate and view related personnel.
2, buy submitted for testing emerging issues Monkey:
A, first requires analysis of log information
b, again to confirm whether the bug has been submitted? Whether new bug and run out of the question that had been submitted consistent?
c, such inconsistency, then, belong to the same problem, as null pointer exception, is then put log information about the problem comment to the bug information together, and add all of the log information
d, and if not, nor belong to the same problem, then , you can submit a new bug
3, in java programming, generic exception will be thrown xxx exception information, you can follow up xxx related judgments and analyzes, specific exceptions you need to analyze specific issues.

6, common abnormal java

  • Arithmetic exception classes: ArithmeticExecption
  • Null pointer exception classes: NullPointerException
  • Type cast exception: ClassCastException
  • Negative array index anomalies: NegativeArrayException
  • Cross-border abnormal array subscript: ArrayIndexOutOfBoundsException
  • A security breach anomaly: SecturityException
  • End of file an exception: EOFException
  • File not found an exception: FileNotFoundException
  • String into a number abnormalities: NumberFormatException
  • Operation database exception: SQLException
  • Input and output Abnormal: IOException
  • Illegal Access Error: IllegalAccessError
  • Memory error: OutOfMemoryError
  • Stack overflow error: StackOverflowError 1

Four .percent related commands to control the type of event, if we do not specify the type of event. Report generation, the proportion of events is as follows:


// Event percentages:

// 0: 15.0%

// 1: 10.0%

// 2: 2.0%

// 3: 15.0%

// 4: -0.0%

// 5: 25.0%

// 6: 15.0%

// 7: 2.0%

// 8: 2.0%

// 9: 1.0%

// 10: 13.0%


Here the event is divided into 10 types, namely:

0: the percentage of the touch event, that argument --pct-touch

1: percentage slip event, i.e. --pct-motion parameter

2: Scaling percentage of events that parameter --pct-pinchzoom

3: Percentage trackball event, that argument --pct-trackball

4: Percentage screen rotation event,

5: Percentage basic navigation event, that argument --pct-nav

6: Percentage main navigation event, that argument --pct-majornav

7: Percentage of system events that parameter --pct-syskeys

8: Activity percentage of start event, that argument --pct-appswitch

9: Keyboard Flip percentage of events that parameter --pct-flip

10: Percentage of other events that parameter --pct-anyevent

 



Guess you like

Origin www.cnblogs.com/wuzm/p/10965762.html