Prevent Photos, iTunes, etc. opening when new device is connected
The Photos problem could be solved by typing the following into a Terminal defaults write com.apple.Photos shouldAutoLaunch 0 and defaults write com.apple.Photos canAutoLaunch 0

You can stop iTunes from opening by going to System Preferences&gt;Users &amp; Groups&gt;Login Items and remove iTunes Helper from the list.