From the terminal, how can I disable iTunes from running when a device is connected? Using terminal, I want to disable the feature of iTunes that causes it to run whenever a device is plugged in, but I want to do this entirely from the terminal, so that it can be part of an OSX setup script.
You should be able to run this command in terminal, then restart iTunes:

defaults write com.apple.iTunesHelper ignore-devices 1