Preference Panes

RSS for tag

Integrate your app's custom preferences into the System Preferences app using Preference Panes.

Posts under Preference Panes tag

23 Posts

Post

Replies

Boosts

Views

Activity

Dynamically resizing NSPreferencePane content
Is it not possible to dynamically change or constrain an NSPreferencePane's mainView size? I have looked all over and this doesn't seem to be mentioned anywhere. The most I can seemingly do is set the frame and hope the user doesn't resize the window. class scor: NSPreferencePane { override func mainViewDidLoad() { mainView = NSHostingView(rootView: ContentView()) mainView.frame = NSMakeRect(0, 0, 668, 1048) } } Here is a screenshot, just with a simple webview as a test, note the scrollbar: My storyboard is just from the default prefpane Xcode template, nothing special. I looked at the header file for NSPreferencePane and came up with nothing. All I can think of is that this is impossible due to the way they are implemented? The only thing we seemingly have access to is mainView, so I can't like constrain the size of mainView to its parent, for example. Additionally, if I make a new preference pane, and make a button or other view that I choose to resize to fill horizontally and vertically, it does that, but not really? Here is what that looks like: The behaviour is similar to the previous preference pane, the width does adapt correctly, the height stays the same, forever. Not that it really matters but I am using macOS 14.7.6 on an M2 air
0
0
117
Jun ’25
Can't NSUserDefaults be used between container apps and system extensions?
Hi, I try to use NSUserDefaults to share some parameter values ​​between the container app and the system extension. I have added the App Group in Signing & Capabilities in both apps. I set it in the container app and read it in the system extension app, but the information I read from the system extension is nil. I tested that I can read the information directly from the container app. Is the system extension running in the sandbox not allowed to read other app information? But the information I see should be OK, as shown below: The container app code is as follows: NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.yourcompany.shared"]; [sharedDefaults setObject:@"Sample Data" forKey:@"SharedData"]; [sharedDefaults synchronize]; The system expansion reading code is as follows: NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.yourcompany.shared"]; NSString *data = [sharedDefaults objectForKey:@"SharedData"]; os_log_debug(logHandle, "NSUserDefaults: %{public}@", data);
1
0
573
Nov ’24
Opening the Extension menu in the System Preferences
Hi there, I have two extension in my App, a Finder Sync and a Share Extension. Because these are disabled by default and automatically enabling them is, according to my extensive research, not possible, I want to provide an easy way for the user to enable the extensions when the app is opened. I am currently displaying a popup, with a button to open the preferences. I have struggled with this a bit, by now I managed to open the main preferences window using NSWorkspace.shared.open(URL(string: "x-apple.systempreferences:com.apple.preference")!) which is rather suboptimal though, since the user has to select the extensions option manually and isn't directly redirected there. What I have also found is that the menu of the FinderSyncExtension can be opened directly by using FIFinderSyncController.showExtensionManagementInterface() which is unfortunately suboptimal as well, because it only shows the managment interface of the finder extension and not the overview of all extensions. Is there any way to either enable the extensions programatically, or if not, is there a way to show the "Added Extensions" portion of the Extensions menu in the system preferences?
7
1
4.8k
Sep ’24
link to open endpoint security extensions via swiftUI
Hi Team, In previous macOS version, We were using this link to open system extension permission page programmatically for our swift app. x-apple.systempreferences:com.apple.preference.security?General In macos 15 (Sequoia), this pane is moved to system settings-> general->login Items and extensions->end point security extensions which is a modal/popup. Can you please share what should be link to open exact this popup for asking permissions.It appears when you click on i button against end point security extensions Based on apple script I could find following link but it opens login item & extensions pane, I want the next popup as above screenshot. "x-apple.systempreferences:com.apple.LoginItems-Settings.extension?extensionItems™
1
0
898
Sep ’24
Including a prefpane in App bundle?
Somewhere in the back of my head, I seem to remember that we can include prefPanes in our app store distributed apps these days (much like we can now include driverkit extensions). I can't for the life of me find this in the documentation again though. Can we do this? Or do I need to copy it from my app bundle to ~/Library/PreferencePanes? Thanks!
3
0
875
Jun ’24
Changing Accessibility Settings from Within a Script
Hello, Recently, I've been hacking at trying to find a way for the colors of the system cursor to be changed via an executable (in particular, I'm trying to get them to match the foreground/background colors chosen by wal.) In my most recent investigation, I've located the relevant setting in ~/Library/Preferences/com.apple.universalaccess (which is a wierd place for it to be, but w/e) and attempted to change it via defaults write. This immediately caused all my GUI apps including Finder to crash repeatedly until I went into recovery mode and deleted the changed file. My next direction in this quandary, then, is to make an application that asks for the relevant Accessibility settings (via the standard prompt that I often see) and upon being granted proper permission, is able to make the modifications without breaking the system. Is anyone able to point me towards the documentation for such functionality, if it's possible? Preferably some kind of C or shell interface.
0
0
801
Apr ’24
add app preferences into the visionOS Settings app
Hello everyone, I am currently developing an application for visionOS and would like to integrate my app's preferences into the Settings app. This will allow users to easily access and modify settings specific to my application directly from the system settings interface. I have done this in iOS using Settings.bundle but unfortunately it is not available in visionOS applications. Does anyone know how to achieve this integration? I would greatly appreciate any resources, examples, or tutorials that you can provide to help me with this task. Thank you in advance for your assistance.
0
0
674
Feb ’24
DesktopScreenEffectsPref
How can I update data in /System/Library/PreferencePanes/DesktopScreenEffectsPref.prefPane ? I download custom video, put it to /Library/Application Support/com.apple.idleassetsd/Customer/4KSDR240FPS added row to /Library/Application Support/com.apple.idleassetsd/Aerial.sqlite added info to /Library/Application Support/com.apple.idleassetsd/Customer/entries.json but new item appears only after system restarting. Can I update data in that preferences?
1
0
806
Oct ’23
On macOS Open system settings > Security & Privacy > Calendar - Follow-up: 814223720
Hi, I have a Mac app that uses calendar. When the user has not granted access and still wants to access the calendar I would like to open System Settings Privacy and Security pane for calendar on the mac. How can I do this? Is it ok to open system settings this way? Or is there a better way? I would like to publish this app to the AppStore so want to know if this is ok? if let urlString = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Calendars") { NSWorkspace.shared.open(urlString) }
2
0
2.0k
Nov ’22
macOS System Preferences/Settings plugin using privileged helper (SMJobBless) to update configuration fails
My software is a daemon that is launched via a plist in /Library/LaunchDaemons . Naturally it does not have GUI and other than configuring the runtime during its installation (.pkg) I imagined that creating a System Preferences plugin for my software would allow a privileged user to make changes to the software's runtime configuration. For example the plugin would allow a privileged user to start and stop the daemon. The installer plugin and its helper were setup and signed so that they - in theory - should work together like the SMJobBless examples do. The only difference from examples like EvenBetterAuthorizationSample from what I can tell is that those examples are using a *.app as opposed to a *.prefPane . The SMJobBless error message output to console is: The operation couldn’t be completed. (CFErrorDomainLaunchd error 2.) Is there a limitation in using System Preferences/Settings with SMJobBless?
3
0
1.1k
Aug ’22
Deeplinks into new System Settings app in macOS Ventura
Hi, in past several versions of macOS, following deep links into System Preferences were working: FileVault: x-apple.systempreferences:com.apple.preference.security?FDE Software update: x-apple.systempreferences:com.apple.preference.softwareupdate GateKeeper and System Extensions: x-apple.systempreferences:com.apple.preference.security?General Focus: x-apple.systempreferences:com.apple.preference.security?Privacy_Focus Full Disk Access: x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles And many others They do not work in macOS Ventura anymore. Is there a replacement in macOS Ventura available? Could you please add/document new deep links into System Settings app? We use it to guide users through different setup steps that have to be done to fully setup/onboard our macOS software. Thank you for any information, Jakub
3
1
3.2k
Jul ’22
How do I disable "Passwords" in macOS Monterey's System Preferences?
How do I disable "Passwords" in macOS Monterey's System Preferences? I don't see "Passwords" in the Restricted Payload preferences in the Profile Manager. I need to press the "Passwords" domain. For example: "Battery" -> "com.apple.preferences.battery" Reference) https://developer.apple.com/documentation/devicemanagement/systempreferences
0
0
946
Mar ’22
Building Preference Pane or Standalone App
I'm updating a very old and abandoned Obj-C app and rewriting it in Swift. At its most fundamental level, this update is to get at least the original functionality included in my new app, but I do have plans for more features that the original didn't offer. Originally the app was configured by just a System Preferences Preference Pane and had no GUI of its own. I'm curious if I should stick to that methodology or if I should build an actual app. This is an app that will be running as a service in the background and will not need any UI to interact with beyond the configuration of its settings. What are the current best practices? Should I rewrite it as a more modern Preference Pane plug-in or should I build it more as maybe a menubar app that then allows me to access its preferences that way (as well as maybe turning the app as a whole on and off which the original version did not allow)?
1
0
928
Dec ’21
Updates to Battery and Power Adaptor prefs (old energy saver prefs)
I'm using CFPreferencesSetValue and and CFPreferencesSynchronize. I can see the change reflected in the com.apple.powermanagement.plist but when I use pmset to inspect the numbers currently in use they are not what is set in the preference plist. I'm losing my mind as I've been working on this for several weeks (on and off) trying to solve it. Can anyone provide a clue as to what I should do?
0
0
488
Oct ’21
System Prefs panel crash on Monterey
We have a system prefs panel that runs fine on many versions of mac OS, including Big Sur, but crashes on Monterey betas. The pref panel needs to do some IPC with a daemon process, for which it uses mach ports (and the code for that is in a shared framework outside of the prefpane bundle, if that matters). All components of this setup are signed and notarized. We have a separate app that makes the same IPC calls as the pref panel, and it runs fine on Monterey. The crash log shows a Termination Reason I've never seen before, and it seems that crash reporter hasn't either: Termination Reason: Namespace <0x17>, Code 0x2000020000013507 So, should we wait for the next beta and see if things fix themselves, or bag the System Preferences environment altogether and just go with a separate app (20 years of documentation be damned)?
0
0
655
Sep ’21
Dynamically resizing NSPreferencePane content
Is it not possible to dynamically change or constrain an NSPreferencePane's mainView size? I have looked all over and this doesn't seem to be mentioned anywhere. The most I can seemingly do is set the frame and hope the user doesn't resize the window. class scor: NSPreferencePane { override func mainViewDidLoad() { mainView = NSHostingView(rootView: ContentView()) mainView.frame = NSMakeRect(0, 0, 668, 1048) } } Here is a screenshot, just with a simple webview as a test, note the scrollbar: My storyboard is just from the default prefpane Xcode template, nothing special. I looked at the header file for NSPreferencePane and came up with nothing. All I can think of is that this is impossible due to the way they are implemented? The only thing we seemingly have access to is mainView, so I can't like constrain the size of mainView to its parent, for example. Additionally, if I make a new preference pane, and make a button or other view that I choose to resize to fill horizontally and vertically, it does that, but not really? Here is what that looks like: The behaviour is similar to the previous preference pane, the width does adapt correctly, the height stays the same, forever. Not that it really matters but I am using macOS 14.7.6 on an M2 air
Replies
0
Boosts
0
Views
117
Activity
Jun ’25
Can't NSUserDefaults be used between container apps and system extensions?
Hi, I try to use NSUserDefaults to share some parameter values ​​between the container app and the system extension. I have added the App Group in Signing & Capabilities in both apps. I set it in the container app and read it in the system extension app, but the information I read from the system extension is nil. I tested that I can read the information directly from the container app. Is the system extension running in the sandbox not allowed to read other app information? But the information I see should be OK, as shown below: The container app code is as follows: NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.yourcompany.shared"]; [sharedDefaults setObject:@"Sample Data" forKey:@"SharedData"]; [sharedDefaults synchronize]; The system expansion reading code is as follows: NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.yourcompany.shared"]; NSString *data = [sharedDefaults objectForKey:@"SharedData"]; os_log_debug(logHandle, "NSUserDefaults: %{public}@", data);
Replies
1
Boosts
0
Views
573
Activity
Nov ’24
Opening the Extension menu in the System Preferences
Hi there, I have two extension in my App, a Finder Sync and a Share Extension. Because these are disabled by default and automatically enabling them is, according to my extensive research, not possible, I want to provide an easy way for the user to enable the extensions when the app is opened. I am currently displaying a popup, with a button to open the preferences. I have struggled with this a bit, by now I managed to open the main preferences window using NSWorkspace.shared.open(URL(string: "x-apple.systempreferences:com.apple.preference")!) which is rather suboptimal though, since the user has to select the extensions option manually and isn't directly redirected there. What I have also found is that the menu of the FinderSyncExtension can be opened directly by using FIFinderSyncController.showExtensionManagementInterface() which is unfortunately suboptimal as well, because it only shows the managment interface of the finder extension and not the overview of all extensions. Is there any way to either enable the extensions programatically, or if not, is there a way to show the "Added Extensions" portion of the Extensions menu in the system preferences?
Replies
7
Boosts
1
Views
4.8k
Activity
Sep ’24
link to open endpoint security extensions via swiftUI
Hi Team, In previous macOS version, We were using this link to open system extension permission page programmatically for our swift app. x-apple.systempreferences:com.apple.preference.security?General In macos 15 (Sequoia), this pane is moved to system settings-&gt; general-&gt;login Items and extensions-&gt;end point security extensions which is a modal/popup. Can you please share what should be link to open exact this popup for asking permissions.It appears when you click on i button against end point security extensions Based on apple script I could find following link but it opens login item &amp; extensions pane, I want the next popup as above screenshot. "x-apple.systempreferences:com.apple.LoginItems-Settings.extension?extensionItems™
Replies
1
Boosts
0
Views
898
Activity
Sep ’24
Including a prefpane in App bundle?
Somewhere in the back of my head, I seem to remember that we can include prefPanes in our app store distributed apps these days (much like we can now include driverkit extensions). I can't for the life of me find this in the documentation again though. Can we do this? Or do I need to copy it from my app bundle to ~/Library/PreferencePanes? Thanks!
Replies
3
Boosts
0
Views
875
Activity
Jun ’24
Changing Accessibility Settings from Within a Script
Hello, Recently, I've been hacking at trying to find a way for the colors of the system cursor to be changed via an executable (in particular, I'm trying to get them to match the foreground/background colors chosen by wal.) In my most recent investigation, I've located the relevant setting in ~/Library/Preferences/com.apple.universalaccess (which is a wierd place for it to be, but w/e) and attempted to change it via defaults write. This immediately caused all my GUI apps including Finder to crash repeatedly until I went into recovery mode and deleted the changed file. My next direction in this quandary, then, is to make an application that asks for the relevant Accessibility settings (via the standard prompt that I often see) and upon being granted proper permission, is able to make the modifications without breaking the system. Is anyone able to point me towards the documentation for such functionality, if it's possible? Preferably some kind of C or shell interface.
Replies
0
Boosts
0
Views
801
Activity
Apr ’24
add app preferences into the visionOS Settings app
Hello everyone, I am currently developing an application for visionOS and would like to integrate my app's preferences into the Settings app. This will allow users to easily access and modify settings specific to my application directly from the system settings interface. I have done this in iOS using Settings.bundle but unfortunately it is not available in visionOS applications. Does anyone know how to achieve this integration? I would greatly appreciate any resources, examples, or tutorials that you can provide to help me with this task. Thank you in advance for your assistance.
Replies
0
Boosts
0
Views
674
Activity
Feb ’24
DesktopScreenEffectsPref
How can I update data in /System/Library/PreferencePanes/DesktopScreenEffectsPref.prefPane ? I download custom video, put it to /Library/Application Support/com.apple.idleassetsd/Customer/4KSDR240FPS added row to /Library/Application Support/com.apple.idleassetsd/Aerial.sqlite added info to /Library/Application Support/com.apple.idleassetsd/Customer/entries.json but new item appears only after system restarting. Can I update data in that preferences?
Replies
1
Boosts
0
Views
806
Activity
Oct ’23
Navigate/Link User to a Deep System Setting
How can i show a link in my app to direct access a deep system setting. if a user click a link, app should directly open the deep settings page. For Ex: "Enable Dictation" (Settings-&gt;General-&gt;Keyboards) App Type: Multiplatform(Swift) minimum deployments: ios: 16.4 Mac os: 13.3 Any Help really appreciated.
Replies
0
Boosts
0
Views
774
Activity
Aug ’23
On macOS Open system settings > Security & Privacy > Calendar - Follow-up: 814223720
Hi, I have a Mac app that uses calendar. When the user has not granted access and still wants to access the calendar I would like to open System Settings Privacy and Security pane for calendar on the mac. How can I do this? Is it ok to open system settings this way? Or is there a better way? I would like to publish this app to the AppStore so want to know if this is ok? if let urlString = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Calendars") { NSWorkspace.shared.open(urlString) }
Replies
2
Boosts
0
Views
2.0k
Activity
Nov ’22
macOS System Preferences/Settings plugin using privileged helper (SMJobBless) to update configuration fails
My software is a daemon that is launched via a plist in /Library/LaunchDaemons . Naturally it does not have GUI and other than configuring the runtime during its installation (.pkg) I imagined that creating a System Preferences plugin for my software would allow a privileged user to make changes to the software's runtime configuration. For example the plugin would allow a privileged user to start and stop the daemon. The installer plugin and its helper were setup and signed so that they - in theory - should work together like the SMJobBless examples do. The only difference from examples like EvenBetterAuthorizationSample from what I can tell is that those examples are using a *.app as opposed to a *.prefPane . The SMJobBless error message output to console is: The operation couldn’t be completed. (CFErrorDomainLaunchd error 2.) Is there a limitation in using System Preferences/Settings with SMJobBless?
Replies
3
Boosts
0
Views
1.1k
Activity
Aug ’22
Deeplinks into new System Settings app in macOS Ventura
Hi, in past several versions of macOS, following deep links into System Preferences were working: FileVault: x-apple.systempreferences:com.apple.preference.security?FDE Software update: x-apple.systempreferences:com.apple.preference.softwareupdate GateKeeper and System Extensions: x-apple.systempreferences:com.apple.preference.security?General Focus: x-apple.systempreferences:com.apple.preference.security?Privacy_Focus Full Disk Access: x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles And many others They do not work in macOS Ventura anymore. Is there a replacement in macOS Ventura available? Could you please add/document new deep links into System Settings app? We use it to guide users through different setup steps that have to be done to fully setup/onboard our macOS software. Thank you for any information, Jakub
Replies
3
Boosts
1
Views
3.2k
Activity
Jul ’22
Desktop picture Pref Pane cropped on selection
When I select a picture in the Desktop picture pref pane, the pane shifts its display up about 15% and so crops off the top 15% of its area. This is on a Mac Studio Max running macOS 12.3.1. This does not occur on a late 2015 iMac using the same desktop picture files and also running 12.3.1. See attached example:
Replies
1
Boosts
0
Views
1.7k
Activity
Apr ’22
How do I disable "Passwords" in macOS Monterey's System Preferences?
How do I disable "Passwords" in macOS Monterey's System Preferences? I don't see "Passwords" in the Restricted Payload preferences in the Profile Manager. I need to press the "Passwords" domain. For example: "Battery" -> "com.apple.preferences.battery" Reference) https://developer.apple.com/documentation/devicemanagement/systempreferences
Replies
0
Boosts
0
Views
946
Activity
Mar ’22
DOCK options in System Preference
Hello Team, I am looking for command line or script which help to untick the option in Dock option ( System Preference ) " Show recent applications in Dock" Can you please help with script or command line. We will use this to push to all MACS.
Replies
0
Boosts
0
Views
666
Activity
Mar ’22
App Expose Reordering
Hello, Would anyone know how to change the way App Expose (three / four finger swipe down) for window applications can be rearranged? Right now, it looks like there is no logic for the way the thumbnails are sorted. Thanks!
Replies
0
Boosts
0
Views
1.4k
Activity
Feb ’22
Building Preference Pane or Standalone App
I'm updating a very old and abandoned Obj-C app and rewriting it in Swift. At its most fundamental level, this update is to get at least the original functionality included in my new app, but I do have plans for more features that the original didn't offer. Originally the app was configured by just a System Preferences Preference Pane and had no GUI of its own. I'm curious if I should stick to that methodology or if I should build an actual app. This is an app that will be running as a service in the background and will not need any UI to interact with beyond the configuration of its settings. What are the current best practices? Should I rewrite it as a more modern Preference Pane plug-in or should I build it more as maybe a menubar app that then allows me to access its preferences that way (as well as maybe turning the app as a whole on and off which the original version did not allow)?
Replies
1
Boosts
0
Views
928
Activity
Dec ’21
Updates to Battery and Power Adaptor prefs (old energy saver prefs)
I'm using CFPreferencesSetValue and and CFPreferencesSynchronize. I can see the change reflected in the com.apple.powermanagement.plist but when I use pmset to inspect the numbers currently in use they are not what is set in the preference plist. I'm losing my mind as I've been working on this for several weeks (on and off) trying to solve it. Can anyone provide a clue as to what I should do?
Replies
0
Boosts
0
Views
488
Activity
Oct ’21
Compatibility of iPhone 12 with app fonts such as WeChat
iPhone 12 is adjusted to the minimum in WeChat and the font in the settings is also adjusted to the smallest, it is as big as the standard font of iPhone 11. Why is the gap between the 6.1-inch screen fonts so large? It looks really uncomfortable and affects the user experience.
Replies
0
Boosts
0
Views
634
Activity
Sep ’21
System Prefs panel crash on Monterey
We have a system prefs panel that runs fine on many versions of mac OS, including Big Sur, but crashes on Monterey betas. The pref panel needs to do some IPC with a daemon process, for which it uses mach ports (and the code for that is in a shared framework outside of the prefpane bundle, if that matters). All components of this setup are signed and notarized. We have a separate app that makes the same IPC calls as the pref panel, and it runs fine on Monterey. The crash log shows a Termination Reason I've never seen before, and it seems that crash reporter hasn't either: Termination Reason: Namespace <0x17>, Code 0x2000020000013507 So, should we wait for the next beta and see if things fix themselves, or bag the System Preferences environment altogether and just go with a separate app (20 years of documentation be damned)?
Replies
0
Boosts
0
Views
655
Activity
Sep ’21