Disable auto launching of Photos application on Mac OSX Yosemite & El Capitan

15113
adamlogan

I'm aware that there are solutions existing that allow you to prevent auto launch of applications such as iphoto or the newer replacement, Photos on a per device basis through the UI of Photos itself, and more comprehensive control (can set what application opens) through Image Viewer, but my question is if there is a way to stop Photos from auto-launching universally (no matter what removable media I mount), preferably by issuing a default write command or disabling a launchd plist or similar.

I tried figuring this out on my own, using an article from lifehacker "How to Find Hidden Features in Mac Applications".

I've issued the following commands:

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 

Output of above can be viewed/downloaded via Gist

I've tried out a few stabs with promising strings such as:

defaults write com.apple.Photos canAutoLaunch = 0 defaults write com.apple.Photos shouldAutoLaunch = 0 

No luck so far. I did a:

defaults read com.apple.Photos 

which shows the two writes did get written, but they're not doing anything obvious, and definitely not what I was going for.

I'm not sure what service to do killall on for quicker testing, rebooting to test is kinda overkill. Activity Monitor shows the following with "photo" as the search term:

Photos Agent com.apple.CloudPhotosConfiguration Photolibraryd com.apple.photomoments com.apple.photomodel Photos 

I've tried doing a defaults read on Photos Agent and so on even escaping characters and other variations and whatever with no luck either.

Would appreciate help in achieving the desired effect. Would love education along the way too if that's not too much to ask.

11

6 ответов на вопрос

4
Miles Erickson

Действия по отключению автоматического запуска нового приложения «Фото» в OS X Yosemite (10.10) или El Capitan (10.11):

  1. Подключите камеру или iDevice (iPhone, iPod, iPad и т. Д.)
  2. Откройте приложение Захват изображений
  3. Нажмите на камеру или iDevice в разделе «УСТРОЙСТВА» в верхнем левом углу.
  4. Найдите «Подключение это (устройство) открывается:» в левом нижнем углу
  5. Нажмите на выпадающий список и выберите «Нет приложения»

Screenshot of Image Capture showing dropdown list, with "No application" selected

4
John Faughnan

This worked for me in Yosemite.

# -currentHost is not technically required defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES 

It came from answer to a similar question on AskDifferent:

https://apple.stackexchange.com/questions/188212/prevent-photos-app-on-osx-yosemite-from-starting-when-plugging-in-device

Interestingly the UI setting in Image Capture doesn't do anything but this does.

Выглядело многообещающе, но, к сожалению, это не работает (на 10.9.5, даже после перезагрузки, с или без опции `-currentHost`). mivk 8 лет назад 0
2
Tetsujin

Rather than fumble around trying to find potential strings, I'd just use Image Capture or RCDefaultApp to switch off the 'insert media' issue

Set these all to 'Ignore'
enter image description here

& Secrets pref pane for the 'undiscovered' ones.

enter image description here

2
mivk

On my machine with OS X 10.9.5, it was Image Capture which opened automatically instead of Photos. But anyway, the solution may be the same.

The solution in the accepted answer unfortunately didn't work for me. But this worked:

defaults -currentHost write com.apple.ImageCapture2 HotPlugActionPath '' 

Not sure if -currentHost is really needed, or if it would also work without it.

Maybe it depends on the OS version.

Работал на 10.11.5 тоже отлично. techraf 7 лет назад 0
2
glenn

Из терминала зайдите в /Applications/Photos.app/Contents/MacOS

тип:

sudo mv Photos Photos.old 

нажмите Enter. Вам будет предложено ввести пароль root.

Это должно полностью отключить фотографии. Если вы хотите, чтобы фотографии снова работали, введите

sudo mv Photos.old Photos 
1
user2943160

В ответ на красочное описание этих функций автозапуска я обнаружил, что следующие команды, чтобы отключить функцию «Фотографии», помогли мне справиться с проблемами с картами SD камеры:

defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES defaults -currentHost write com.apple.Photos disableHotPlug -bool YES 

Похожие вопросы