iPhone真机调试日志读取 iPhone Crash Logs

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 15:58 点击:

1.同步应用程序以后,找到你要查看的日志文件,日志文件对应mac的位置,xp\vista的位置.
2.发现日志文件都是看不懂的16进制,如何进行转换成我们看得懂的内容.
3.使用命令行工具 "symbolicatecrash"来进行转换,可以把 工具复制到任何地方都可以调用的路径:sudo cp/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash /usr/local/bin/
4.讲了 "symbolicatecrash" 工具怎么用.一般只要:symbolicatecrash report.crashMobileLines.app.dSYM > report-with-symbols.crash,就可以了
5.注意说明的是,你在用Xcode debug打包的时候,会生成两个东西,一个是XXX.app,另一个是XXX.app.dSYM,这两个是相对应的,与我写的第4点里的 MobileLines.app.dSYM是对应起来的.这里的日志文件必须是你打包的那个版本,不然就没有解析出你的日志文件了.通俗的说,你安装到手机上的app和这个dSYM,是配对的,如果你想要看这个手机上的日志文件,那你必须保存对应的dSYM文件去解析日志文件.每一次重新打包都会重新生成dSYM文件.
6.好了,你可以根据你的 report-with-symbols.crash,日志文件来看看你的程序哪里出问题了
Sometimes programs crash. This annoys users and developers alike. Users are frustrated because they cannot use crashing software, developers are frustrated because they have to hunt bugs instead of doing something creative and rewarding. How do we communicate if an iPhone application crashes?
I’ll start with a disclaimer. I’m not sure whether the information provided in this post is covered by iPhone Developer Program NDA or not. If it is, the post will be removed. Secondly, this post is a result of googling, so I haven’t invented anything new here.
Working with crash logs typically involves certain interaction between developers and users, unless they are automagically sent to the developer. First of all, the user should get the crash log and send it to the developer, who should examine it, find the bug and fix it.
iPhone OS and Mac OS X are remarkably similar architectures. Both store crash logs to help identify crashing bugs. The difference between the two is how users retrieve them. On Mac OS X every user has unrestricted access to crash logs related to the applications she runs. The iPhone does not even have a file browser. What to do? iTunes comes to the rescue.
Whenever you synchronize your iPhone or iPod Touch, all the crash logs are transferred to your computer. Here are their locations:
• Mac OS X:~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>
• Windows XP:C:\Documents and Settings\<USERNAME>\Application Data\Apple computer\Logs\CrashReporter/<DEVICE_NAME>
• Windows Vista:C:\Users\<USERNAME>\AppData\Roaming\Apple computer\Logs\CrashReporter/MobileDevice/<DEVICE_NAME>
The log file names start with application name and have the extension “crash”. They are just plain text files and can be sent by e-mail in original or zipped form, or even copy-pasted into your e-mail program.
The second part is trickier. Both Apple and common sense suggest that all AppStore binaries are shipped with stripped symbols. If you ever saw a crash log like this, read on:
Thread 0 Crashed:0   libobjc.A.dylib           0x300c87ec 0x300bb000 + 552761   MobileLines               0x00006434 0x1000 + 215562   MobileLines               0x000064c2 0x1000 + 216983   UIKit                     0x30a740ac 0x30a54000 + 1312444   UIKit                     0x30a66110 0x30a54000 + 740005   UIKit                     0x30a65

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • Lexical or Preprocessor Issue 'xxx.h
      • ios学习笔记(二)xcode 4.3.2下实现基本交互
      • ios版本的helloworld
      • iphone(object-c) 内存管理(3) 有效的内存管理 前半部分
      • ios学习笔记(一)xcode 4.3.2下创建第一个ios项目
      • UITableView一些方法
      • IOS类似iphone通讯录TableView的完整demo【附源码】
      • [iPhone中级]iPhone团购信息客户端的开发 (二)
      • iphone(object-c)内存管理(1)
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1