Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run Preference Pane application

I created a new Xcode Preference Pane project which I aim to run in the System Preference application. I have made one modification to the project's build settings:

  1. Changed Base SDK to Mac OS X 10.6 from 10.7 (Since I want to keep compatibility for Snow Leopard).

I have a nib file and NSPreferencePane subclass, yet Xcode doesn't allow me to run the application (only build it, the Run option is disabled).

My environment specs:

  • Macbook Pro 2010
  • Mac OS X Lion (10.7)
  • Xcode 4.2
like image 475
Rami Avatar asked Sep 11 '11 01:09

Rami


People also ask

Can not load Apple ID preference pane?

Answer: A: Try booting to Safe Mode. That boot up takes minutes and clears caches and other things that may resolve your problem. A lot of times just boot to Safe Mode followed by normal boot resolves problems.

Why can't my Mac Open System Preferences?

Quick Fixes for Mac System Preferences not respondingForce restart Mac. Delete Preferences plist file. Run Disk Utility First Aid. Restart Mac in Safe Mode.


1 Answers

With Xcode Schemes you can now do this very nicely. Edit the Run action of the scheme like so:

  • Set the Executable to System Preferences.app
  • Go to the Arguments tab and pass a launch argument: $USER_LIBRARY_DIR/PreferencePanes/$FULL_PRODUCT_NAME
  • Now expand the Run/Debug scheme and click on "Pre-actions"
  • Add a script pre-action with the following body: cp -a "$TARGET_BUILD_DIR/$FULL_PRODUCT_NAME" "$USER_LIBRARY_DIR/PreferencePanes/"

Bingo. Run will now launch System preferences and go directly into your prefpane.

By default, schemes are per-user and thus you are probably excluding them from your repository, and even if not other users won't see them. Go to "Manage Schemes..." and mark the prefPane scheme as shared if you want others to get these settings.

NB: For some reason I seem to get random crashes when you launch the prefPane as an argument. Just turn off the argument and manually launch once - from then on you can use the argument again...

like image 173
Mark Aufflick Avatar answered Sep 30 '22 06:09

Mark Aufflick