I managed to work out a way to do it using this, this, and this. You will need the XCode command line tools, which come as part of the App Store XCode install, or you can get the command line tools only from here.
First up, download and install npm. Then install ios-deploy
from the terminal,
sudo npm install -g ios-deploy --unsafe-perm --allow-root
If you need to build from the command line, make sure you have a working XCode project which builds as you want, open a terminal and go to the directory with your .xcodeproj
inside, then type:
xcodebuild -list -project <NAME>.xcodeproj/
xcodebuild -scheme <SCHEME NAME> build
Then, or if you've already built in XCode and just want to deploy your .app
file to the iOS device, type:
ios-deploy debug --bundle <APP PATH>
You can change debug
to release
, or either way it will use whatever you set your XCode build configuration to be I think. The <APP PATH>
location depends on your XCode install, but the most recent location (I think) is
~/Library/Developer/Xcode/DerivedData/{app name}/Build/Products/Deployment/
This will install your .app
onto the iOS device from the command line, and you don't need to load XCode up, or expose your source files. Just requires the .app
file. For me, this is a potentially useful way to install an app remotely on a client's device without the need for a paid developer account.