小编ada*_*gan的帖子

在 Mac OSX Yosemite & El Capitan 上禁用照片应用程序的自动启动

我知道有一些现有的解决方案允许您通过照片本身的 UI 阻止自动启动应用程序,例如 iphoto 或更新的替代品、照片,以及更全面的控制(可以设置打开的应用程序)通过 Image Viewer,但我的问题是是否有办法阻止照片普遍自动启动(无论我安装什么可移动媒体),最好是通过发出默认写入命令或禁用 launchd plist 或类似的。

我尝试自己解决这个问题,使用 Lifehacker 的一篇文章“如何在 Mac 应用程序中查找隐藏功能”。

我发出了以下命令:

strings /Applications/Photos.app/Contents/MacOS/Photos > Desktop/photosstrings.txt

class-dump /Applications/Photos.app/Contents/MacOS/Photos > Desktop/photosclassdump.txt

strings /Applications/Photos.app/Contents/MacOS/PhotosRelauncher > Desktop/photosrelauncherstrings.txt

class-dump /Applications/Photos.app/Contents/MacOS/PhotosRelauncher > Desktop/photosrelauncherclassdump.txt
Run Code Online (Sandbox Code Playgroud)

上面的输出可以通过Gist查看/下载

我已经尝试了一些很有前途的字符串,例如:

defaults write com.apple.Photos canAutoLaunch = 0

defaults write com.apple.Photos shouldAutoLaunch = 0
Run Code Online (Sandbox Code Playgroud)

到目前为止没有运气。我做了一个:

defaults read com.apple.Photos
Run Code Online (Sandbox Code Playgroud)

这表明这两篇文章确实被写了,但他们没有做任何明显的事情,绝对不是我想要的。

我不确定要在什么服务上执行 killall 以加快测试速度,重新启动以进行测试有点矫枉过正。活动监视器以“照片”作为搜索词显示以下内容:

Photos Agent
com.apple.CloudPhotosConfiguration
Photolibraryd
com.apple.photomoments
com.apple.photomodel
Photos
Run Code Online (Sandbox Code Playgroud)

我试过在照片代理上读取默认值,等等甚至转义字符和其他变体以及任何没有运气的东西。

将不胜感激帮助实现预期的效果。如果要求不高的话,我也会喜欢一路上的教育。

photos command-line removable-media osx-yosemite osx-el-capitan

11
推荐指数
1
解决办法
2万
查看次数