Real Software Forums
http://forums.realsoftware.com/

Debugging sandbox app
http://forums.realsoftware.com/viewtopic.php?f=7&t=45896
Page 1 of 1

Author:  HardyMachia [ Tue Nov 13, 2012 4:52 pm ]
Post subject:  Debugging sandbox app

Is there any simple way to debug an app to make it sandbox compatible?

I have pre-sandbox app. Works likes typical app where it stores preference file, lets user open/save/import/export files, use the camera, print, and it uses SQLite for it's main data file.

I build for cocoa, sign it, run it, log in with my sandbox itunes account... then the app crashes.

I can put up alert boxes to try to figure out where the crashes are happening, but is it possible to debug it with the RB debugger?

Author:  Thom McGrath [ Tue Nov 13, 2012 5:10 pm ]
Post subject:  Re: Debugging sandbox app

Use build automation. A post-build IDE script step will do the job nicely:
dim app as string = CurrentBuildLocation + "/""" + CurrentBuildAppName + ".app"""
call DoShellCommand("codesign -f -s ""My Company Name"" --entitlements ""$PROJECT_PATH/../Build/Mac/Sandbox.entitlements"" """ + app + """")
You will of course have to change the name of the certificate you wish to use, and adjust the path to the entitlements file. But if you have it setup correctly, your debug builds will be signed and sandboxed automatically before being launched.

Author:  rowlands [ Tue Nov 13, 2012 9:09 pm ]
Post subject:  Re: Debugging sandbox app

Are you testing on Mac OS X 10.7.0~7.2? These versions have a flaky Sandbox, where apps can crash on launch and there is no way to access files that you app previously accessed.

If you are running 10.7.0~7.2, update to 10.7.5.

You also need to make sure that you are setting the correct entitlements (although I've never seen an app crash because the entitlements were not configure correctly), you'll need entitlements for open/save dialogs, printing and camera access. If you're accessing a USB camera (not the built-in Apple camera) you may also need USB entitlements.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/