Using xcodebuild to install the build target onto a connected iOS device

I'm trying to write a script that builds and installs my iOS project on one of my iOS devices.

I am not able to get xcodebuild to actually install the app on my iOS device:

xcodebuild -project MyProject.xcodeproj -scheme "MyScheme" -destination "platform=iOS,name=My iPhone" build install

The project builds but the app doesn't end up installed on the device. Is this possible with xcodebuild?

Using xcodebuild to install the build target onto a connected iOS device
 
 
Q