zoukankan      html  css  js  c++  java
  • Xcode4 使用 Organizer 分析 Crash logs(转)

    一.四种崩溃类型

    • 程序崩溃: 可能是最常见的,经常发生于内存访问出错,异常,或者其他的程序错误

    • 内存不足: 系统因为没有足够的内存满足程序需求从而杀死程序出现这种日志.它不同于其他日志的是它没有程序各线程的堆栈信息. Rather than be concerned about what part of your code was executing at the time of termination, you should investigate your memory usage patterns and your responses to low memory warnings. Memory usage of each process is reported in terms of number of memory pages, which as of this writing are 4KB each.

    • 强制退出:异常代码 0xdeadfa11. 这出现在用户在程序界面按下关机键知道出现"移动滑块关机",然后长按Home键.用户之所以这么做,很可能因为你的程序无响应,当然也不一定.

    • 响应超时: 异常代码 0x8badf00d

       

      . 出现在程序启动慢,运行慢,响应慢.

       

        

    除了内存不足,其他日志都包含终止时各线程的堆栈信息.


    二.分析

    1.建立一个文件夹,存放你编译到手机上的.app和对应的.dSYM文件.(喜欢放桌面,home目录的跳过)终端输入命令

    mdimport "你刚刚建的文件夹目录"

    这时为了确保目录在spotlight索引目录里.

    2.编译app到你的手机上,同时存储当时生成的.app和.dSYM到刚刚创建的文件夹(同一文件夹,不要改名)

    3.狂乱操作你的手机吧,出错了,xcode4打开organizer,点击崩溃日志,看看,不是以前那种冏来冏去的地址代码了吧,有出错的函数名称,位置等.调试改错吧.(针对第二种错误报告)

    三.得到崩溃日志

    联机后,崩溃日志会被iTunes拷贝,各平台下日志目录如下:

    • Mac OS X: ~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>

    • Windows XP: C:\Documents and Settings\<USERNAME>\Application Data\Apple Computer\Logs\CrashReporter\MobileDevice\<DEVICE_NAME>

    • Windows Vista or 7: C:\Users\<USERNAME>\AppData\Roaming\Apple Computer\Logs\CrashReporter\MobileDevice\<DEVICE_NAME>

    <USERNAME> 电脑用户名 <DEVICE_NAME> ios设备名称

    参考:http://developer.apple.com/library/ios/#technotes/tn2151/_index.html

    Xcode Organizer可以直接或者这些错误报告.

    转自: http://www.cnblogs.com/v2m_/archive/2011/08/16/2141337.html
  • 相关阅读:
    Sublime 设置移动光标快捷键
    Reverse Linked List II
    Reverse Nodes in K-Group
    Sort Colors
    Swap Nodes in Pairs
    Intersection of Two Linked Lists
    Word Break
    Unique Binary Search Tree
    Maximal Square
    Happy Number
  • 原文地址:https://www.cnblogs.com/likwo/p/2142565.html
Copyright © 2011-2022 走看看