iOS crash与符号化

基础

1 Difference between .ipa and .xcarchive:

  • IPA is a zipped up Payload folder which has YourApp.app bundle. .app contains all your application resources like images, plist files, compressed nibs and the executable, CodeSigning resources,etc.
  • xcarchive contains your app and dsym files. .DSYM is required to desymbolicate your crash logs. Right click on saved .xcarchive and select show package contents to see what it contains.

2 .crash文件

3 .app.dSYM

  • .xcarchive中有

4 .app文件

  • .xcarchive中也有,也可以从.ipa中解压得到,.ipa就是zip文件

5 symbolicatecrash

  • 如果你不知道这个命令在哪儿也没关系
    find /Applications/Xcode.app -name symbolicatecrash -type f
  • 我的电脑是在:
    /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash

入正题

使用symbolicatecrash分析crash文件

  • 首先,在桌面建一个文件夹crash,接着需要准备4个文件(上面的2,3,4,5)
  • /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash aaa.crash bbb.app.dSYM > ccc.txt
  • 如果运行上面命令出现
    Error: "DEVELOPER_DIR" is not defined at ./symbolicatecrash line 60.
    解决方法是输入以下命令:(xcode-select --print-path 可以找到DEVELOPER_DIR)
    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"

参考文献

  • http://www.jianshu.com/p/da186c14db0f
  • https://github.com/answer-huang/dSYMTools

你可能感兴趣的:(iOS crash与符号化)