在终端中为plist添加布尔键

时间:2012-07-19 03:07:48

标签: macos bash shell unix terminal

我目前正在尝试创建一个终端shell,它为现有的plist添加一个名为“disabled”的布尔键,其值为true。

到目前为止,我有defaults write "/System/Library/LaunchAgents/com.apple.AppStoreUpdateAgent" disabled -bool true

我正确设置了布尔值,还是我没有-bool? 应该“禁用”引号?

1 个答案:

答案 0 :(得分:1)

defaults write /System/Library/LaunchAgents/com.apple.AppStoreUpdateAgent disabled -bool true应该是正确的。 disabled不需要引号,-bool true应该有效,但正如@MichaelDautermann所提到的,你需要以root身份运行它。

您还可以使用launchctl unload -w /System/Library/LaunchAgents/com.apple.AppStoreUpdateAgent.plist卸载作业。

-w       Overrides the Disabled key and sets it to false. In previous ver-
         sions, this option would modify the configuration file. Now the
         state of the Disabled key is stored elsewhere on-disk.