Mac/OS/Q/How can I open a particular system setting from the command line?
How can I open a particular system setting from the command line?
General Idea
- On macOS, you can open specific System Settings (or System Preferences on older macOS versions) using the
opencommand in the Terminal. - To open the Displays settings, use the following command:
open "x-apple.systempreferences:com.apple.Displays-Settings.extension" General Syntax:
open "x-apple.systempreferences:<PREFERENCE-PANE>"Other Common Examples:
- General Settings:
open "x-apple.systempreferences:com.apple.general-Settings.extension" - Battery Settings:
open "x-apple.systempreferences:com.apple.Power-Settings.extension" - Keyboard Settings:
open "x-apple.systempreferences:com.apple.Keyboard-Settings.extension" - Trackpad Settings:
open "x-apple.systempreferences:com.apple.Trackpad-Settings.extension"
- General Settings:
- On macOS, you can open specific System Settings (or System Preferences on older macOS versions) using the
Are there any Zsh/OhMyZsh/Plugins that handle the completion of mac system preferences from the command line? #Questionl ANS: AFAICT No
Research
- SystemPreferences/macos_preferencepanes-Ventura.md at main · bvanpeski/SystemPreferences
Apple has made discovering the proper URLScheme extensions for different sections of the app much easier in Ventura, thanks to the unification of settings that the new System Settings app brings. In fact, most of them are stored right inside of the System Settings application itself (
/System/Applications/System Settings.app/Contents/Resources/Sidebar.plistYou can combine the values in that plist with theopen x-apple-systempreferences:command we all know and love and you're off to the races! If any new sections are added in the future, that plist is where you'll want to look.There are a few deeper settings beyond the sidebar that won't be in that plist. To uncover those you can leverage a line of shell script to pull a list of strings out of System Settings to identify any additional sections that you might have missed.
for pref in $(strings "/System/Applications/System Settings.app/Contents/MacOS/System Settings" | awk '/^com.apple./ {print $1 }'); do echo "$pref"; done(hat tip to @bradtchapman in MacAdmin Slack for this one)
- Mac System Settings Links 2024/11 Mac/OS/15/2
- Apple System Preferences URL Schemes GitHub/Gist - originally authored in 2020/03 for Mac/OS/10/15; latest comments from 2024/12
- claims that one can do
open -b com.apple.systempreferences /Path/To/Pane, where the path is/System/Library/PreferencePanes/. comment from GitHub/luckman212 in 2024/10 said he found a protected (passkey required to access) file that listed quite a few; using jq
TCC_SVC_PLIST='/System/Library/ExtensionKit/Extensions/SecurityPrivacyExtension.appex/Contents/Resources/TCCServiceList.plist' plutil -convert json -o - -- $TCC_SVC_PLIST | jq '"x-apple.systempreferences:com.apple.preference.security?" as $p | map(select(.revealElementKeyName) | { tcc: .tcc, serviceName: .serviceName, url: ($p + .revealElementKeyName) })'- ... sample output
[ { "tcc": "kTCCServiceAddressBook", "serviceName": "CONTACTS", "url": "x-apple.systempreferences:com.apple.preference.security?Privacy_Contacts" }, { "tcc": "kTCCServiceReminders", "serviceName": "REMINDERS", "url": "x-apple.systempreferences:com.apple.preference.security?Privacy_Reminders" }, { "tcc": "kTCCServiceBluetoothAlways", "serviceName": "BLUETOOTH", "url": "x-apple.systempreferences:com.apple.preference.security?Privacy_Bluetooth" },- ...
- claims that one can do
- Identifying System Preferences Panes - macOS Adventures
- SystemPreferences/macos_preferencepanes-Ventura.md at main · bvanpeski/SystemPreferences