macosdebuggingapp-bundle

How to debug .app bundle crash-on-startup on Mac OS X?


What is the best way to find out why an .app bundle immediately crashes when started? Does Mac OS X store logs anywhere?

For example, this does not work, and crashes immediately:

open /Applications/MyApp.app

However, calling the executable directly seems to work:

/Applications/MyApp.app/Contents/MacOS/MyAppLauncher

Info.plist should be fine and point to the right executable:

<key>CFBundleExecutable</key>
<string>MyAppLauncher</string>

For all I know, OS X never even calls my code. How can I find out what it is doing, and why it is failing?

Note: This application uses sandboxing, so I presume it has something to do with that. But I'd like to see some logs that confirm that.


Solution

    1. Run the console app, you can find it with spotlight
    2. Run your app
    3. at the bottom of the list, you will see messages the app is sending to log, for eaxmple: MyApp(14489) deny mach-lookup com.apple.networkd