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

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.


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.


Steps to disable automatic launch of the new Photos app on OS X Yosemite (10.10) or El Capitan (10.11):

  1. Connect your camera or iDevice (iPhone, iPod, iPad, etc.)
  2. Open the Image Capture app
  3. Click on your camera or iDevice under "DEVICES" in the upper left corner
  4. Find "Connecting this (device) opens:" in the lower left corner
  5. Click on the dropdown list and select "No application"

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


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


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.


From the Terminal, go into /Applications/Photos.app/Contents/MacOS

type:

sudo mv Photos Photos.old 

press Enter. You will be prompted for the root password.

That should disable Photos completely. If you want Photos to work again, type

sudo mv Photos.old Photos