It can be frustrating to plug your iPhone into your Mac (usually just to charge it) and find that a load of apps open up automatically. Luckily it's pretty easy to stop Photos or iTunes launching on the Mac when you attach your iPhone (or iPad or iPod) via USB.
Stop Photos opening when you plug in an iPhone or iPad
Plug your iDevice into the Mac and go into Photos. In the lefthand sidebar, look under Devices and select your device. At the top of the main pane, you'll see a little tickbox next to the words 'Open Photos'. Click to remove the tick.
If you've got multiple iOS devices then you'll need to plug in each one and repeat this step for each.
Stopping Photos from opening when you attach your iOS device is as simple as unticking a box
Stop iTunes opening when you plug in an iPhone or iPad
To stop iTunes opening, start the app (there's no need to first attach your device) and then open its Preferences dialog box (click the iTunes dropdown menu then select Preferences, or just hit Cmd + comma). Click the Devices icon and then put a tick in the box marked 'Prevent iPods, iPhones and iPads from syncing automatically'.
In one fell swoop you can stop iTunes opening for ALL of your iOS devices!
Alternatively, if you want to stop just one of your iOS devices from opening iTunes, but keep letting your others do so, then attach the device in question so that iTunes opens, then select it in the devices list.
Select Summary in the list at the left, and then under the heading Options, remove the tick from the box headed 'Automatically sync when this [device] is connected'.
Choosing which app launches automatically
Perhaps there's an app you'd like to open when you plug in your iPhone - for example, Image Capture, which is great if all you want to do is grab a photo or video quickly. Luckily, you can make any app start when you attach your iPhone, iPad or iPod Touch.
To configure which, attach the device via its USB cable and then open Image Capture, which you'll find in Finder's Applications list. (Don't worry for now which app you want to open automatically. This process requires us to open Image Capture regardless of the eventual choice.)
Click the small triangle in the Image Capture's bottom-left corner, and make sure your device is selected under the list at the top left.
Back at the bottom left, look for a dropdown menu under the words 'Connecting this [device] opens' (oddly, we've found that the app often simply says 'Camera' even if it's a phone or tablet). Click the menu and choose your desired app.
If none of the default choices takes your fancy, click the Other entry in the list and then browse through your Applications list to find another app.
The venerable Image Capture app lets you control what happens when you insert your iPhone, iPad or iPod touch