Reputation: 1387
One of my projects is a System Preference Pane. With 10.11, Xcode's debugger can't debug it as I get a "can't attach to System Preferences because of System Integrity Protection".
How can I debug my prefpane under 10.11, as I have done in every OS back to 10.3?
Upvotes: 6
Views: 2081
Reputation: 1387
I ended up making a copy of System Preferences, called it "System Preferences (Signed)" and then signed it with my DeveloperID which replaces the old code signature and allows it to run normally without SIP getting in the way.
Upvotes: 8
Reputation: 396
After creating your PreferencePane project edit the build scheme, select the Run scheme on the left list and on the argument tab add an environment variable using + button (variable OBJC_DISABLE_GC and value YES).
Then choose Pre-Actions on the left list and add
cp -Rf ${CONFIGURATION_BUILD_DIR}/BuildOutputPrefPane.prefPane ~/Library/PreferencePanes
Then choose Run on the left list and choose the System Preference.app as Executable from the info tab.
Build your solution and go to build output and install your Preference Pane by clicking on it and replace existing one.
Run you project with the right scheme now if you put a breakpoint in you app and use the installed Preference Pane it works, logging work too.
This work for Swift too.
Tested with Xcode 7.1.1, EL Capitan and Swift 2 language. Enjoy
Upvotes: 0