Handy script for testing WebContent sandbox

Now you can simply create a dynamic library project and click “run” to attach it to sandboxed process.

Save following script to your project. Select Product / Scheme / Edit Scheme… and add it to executable. Uncheck Debug executable since it makes no sense (just directly use lldb outside Xcode).

Make sure your compile target is a MH_BUNDLE.

Switch to Arguments tab and add an environment variable DYLIB=$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH

Now simply click the button to start debugging.

The script can be easily modified to adapt to other sandboxed targets.