xcode - 如何提高 Xcode 控制台输出的质量

标签 xcode

在 Xcode -> Organizer -> My iPhone -> Console 中的 iPhone 控制台日志(参见下面的示例)中转储了大量的低级系统调试通知。

这有效地淹没了我自己的开发输出。 (我正在使用 3rd 方框架(不是 Xcode)制作应用程序,所以我使用 Xcode 仅用于查看手机的控制台输出)。

更糟糕的是,iPhone 控制台日志似乎只回溯了一天或顶部的几百行,所以如果我昨天发生了崩溃,当我到达办公室时,它肯定会被详细的系统通知覆盖调试。

我如何 a) 删除系统通知,b) 延长日志的长度,c) 将日志通过管道传输到 bash 终端,以便我可以对其进行“grep”操作,或者以任何其他方式更好地了解我自己的情况调试输出?

(例如,在 Android 上,您可以执行 adb logcat -s MyApp 以仅查看来自 MyApp 的消息)

这是淹没 iPhone 日志的那种东西的例子:

Dec 12 10:11:02  installd[31] <Error>: 0x2d5000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Xcode (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1d59e7a0 [0x3af630f0]>{type = mutable set, count = 18,
    entries =>
        0 : <CFString 0x3af4f9e4 [0x3af630f0]>{contents = "CFBundlePackageType"}
        1 : <CFString 0x1d59e650 [0x3af630f0]>{contents = "BuildMachineOSBuild"}
        2 : <CFString 0x3af50a34 [0x3af630f0]>{contents = "CFBundleResourceSpecification"}
        3 : <CFString 0x1d5713e0 [0x3af630f0]>{contents = "DTPlatformBuild"}
        4 : <CFString 0x3af4d784 [0x3af630f0]>{contents = "DTCompiler"}
        5 : <CFString 0x3af4f554 [0x3af630f0]>{contents = "CFBundleSignature"}
        6 : <CFString 0x3af50214 [0x3af630f0]>{contents = "DTSDKName"}
        7 : <CFString 0x1d580d60 [0x3af630f0]>{contents = "NSBundleResolvedPath"}
        8 : <CFString 0x3af4cea4 [0x3af630f0]>{contents = "UISupportedInterfaceOrientations"}
        10 : <CFString 0x3af54e74 [0x3af630f0]>{contents = "DTXcode"}
        13 : <CFString 0x3af54ea4 [0x3af630f0]>{contents = "CFBundleInfoDictionaryVersion"}
        16 : <CFString 0x3af522f4 [0x3af630f0]>{contents = "CFBundleSupportedPlatforms"}
        17 : <CFString 0x1d590660 [0x3af630f0]>{contents = "DTXcodeBuild"}
        18 : <CFString 0x1d59af70 [0x3af630f0]>{contents = "UIStatusBarTintParameters"}
        19 : <CFString 0x3af50e44 [0x3af630f0]>{contents = "DTPlatformVersion"}
        20 : <CFString 0x3af53be4 [0x3af630f0]>{contents = "DTPlatformName"}
        21 : <CFString 0x3af54c74 [0x3af630f0]>{contents = "CFBundleDevelopmentRegion"}
        22 : <CFString 0x1d599230 [0x3af630f0]>{contents = "DTSDKBuild"}
    }

最佳答案

很好的问题!我强烈建议您使用这个很棒的工具:

  • NSLogger.
  • NSLogger (Long but Nice) Introduction.
  • Third Party Presentation of the Tool .
  • 这是一个 tip I wrote for multiple users case .

  • 如果你喜欢它,请告诉我。 :-)

    关于xcode - 如何提高 Xcode 控制台输出的质量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13836389/

    相关文章:

    objective-c - 应用程序不再在设备上运行......吓坏了

    ios - 使用推送弹出导航在多个 View Controller 之间传递数据时出现问题

    ios - 在 Xcode 中我看到(没有配对的 Apple Watch)即使 watch 已配对并且 watch 的 UDID 已注册

    ios - 按值传递的结构参数包含未初始化的数据

    ios - 基于 App Store Connect 的 TestFlight 卡在 'Ready to Submit'

    ios-deploy 无法在 Mac OS X El Capitan 10.11 上安装

    ios - xcode 5 本地化失败

    c++ - OpenGL 代码适用于 Windows 但不适用于 Mac

    xcode - 使用 NSuserdefaults 在 Swift 和 Sprite Kit 中设置 HighScore

    ios - MFMailComposeViewController 外观 setTintColor 迷失 iOS 7