I first wanted to do both iOS and Android. Later I tried to collect crashes on Android, which is more difficult than I thought, it can also be said that it is almost impossible to implement a practical and convenient crash Collection System (1. information such as stacks does not cause side effects such as freezing. 2. It refers to JNI crash, and Java crash is easy to handle ). This is a bit worth reflecting on. It is better to waste time in difficult areas than to do simple things well. So many games that make a lot of money are not perfect, but players don't care.ProgramWhether X is good or not, and whether the technology is brilliant, as long as the player wants to play the core point to the extreme.
1. Use the method mentioned in (here) to obtain the stack and upload it directly to the server during crash. This can be roughly located and is in plain text, without the need for additional tools to convert the format. The disadvantage is that the specific row cannot be located. But in many cases, this is enough.
2. Use plcrashreporter to obtain the crash log file. Upload the crashed file to the server when the game starts running next time. The specific analysis process is as follows:
A. Put the dsym file and the crash information file (XX. plcrash) backed up during release to a folder.
B. The required tool plcrashutil (this is in the Tools Folder OF THE plcrashreporter release package) symbolicatecrash (this is in the xcode Program Folder/applications/xcode. APP/contents/developer/platforms/iphoneos. platform/developer/library/privateframeworks/dtdevicekit. framework/versions/A/resources /)
C. run commands
[Plain] View plaincopyprint?
- ./Plcrashutil convert -- format = iPhone live_report.plcrash> test. Crash
- Export cmd_dir =/applications/xcode. APP/contents/Developer
- ./Symbolicatecrash test. Crash DemoCrash-iOS-Device.app.dSYM> crash_readable.log
./Plcrashutil convert -- format = iPhone live_report.plcrash> test. crashexport export _dir =/applications/xcode. APP/contents/developer./symbolicatecrash test. Crash DemoCrash-iOS-Device.app.dSYM> crash_readable.log
The first command converts plcrash to Apple's standard crash format. The second command parses the crash information based on the dsym symbol file and locates specific lines, for example:
[Plain] View plaincopyprint?
- Thread 0 crashed:
- 0 democrash-Ios-device 0x00002780 stackframe (main. M: 41)
-
- thread 1:
- 0 libsystem_kernel.dylib 0x0000ad3a8 kevent + 24
- 1 libdispatch. dylib 0x376dabc9 _ dispatch_mgr_wakeup + 1