Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to improve quality of Xcode console output

Tags:

xcode

There is an extreme amount of low level system debug notices being dumped in the iPhone console log (see example below) in Xcode -> Organizer -> My iPhone -> Console.

This effectively drowns my own development output. (I am making an app using a 3rd party framework (not Xcode), so I am using Xcode only to view the Console output from the phone).

To make matters worse, the iPhone console log only seems to go back one day or a few hundred lines at tops, so if I had a crash yesterday, it's sure to be overwritten by verbose system notices by the time I get to the office for debugging.

How can I a) remove the system notices, b) extend the length of the log, c) pipe the log to a bash terminal so I can do "grep" on it, or any other way to get a better overview of my own debug output?

(For example, on Android, you can do adb logcat -s MyApp to view only messages from MyApp)

Here is an example of the kind of stuff that swamps the iPhone log:

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"}
    }
like image 432
forthrin Avatar asked Dec 12 '12 09:12

forthrin


People also ask

How do I use the console log in IOS simulator?

log , which can be open by Select Simulator -> Debug -> Open System log on Xcode 11.

Does Xcode have a console?

You need to click Log Navigator icon (far right in left sidebar). Then choose your Debug/Run session in left sidebar, and you will have console in editor area.

Where is console output in Xcode?

Go to Xcode → Preferences → Debugging → On Start → "Show Console".


1 Answers

Very good question! I strongly suggest you to use this great tool:

  • NSLogger.
  • NSLogger (Long but Nice) Introduction.
  • Third Party Presentation of the Tool.
  • And here is a tip I wrote for multiple users case.

And please let me know if you like it. :-)

like image 102
MonsieurDart Avatar answered Oct 09 '22 07:10

MonsieurDart