Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OTA AdHoc distribution - how to build an IPA from command line?

I'd like to script my building process.

However - I need to create a IPA for enterprise in order to distribute the app over the air for my testers.

I followed this article's directions, I can create the ipa and plist with some clicking in the Xcode ;) But - I wanted to have it scripted. The real question is how to create the IPA correctly (I need to embed the .mobileprovision file in it, right?) and how to generate the .plist file?

For the plist, should I do this by hand, or xcode would generate it for me if asked nicely?

like image 985
kender Avatar asked Jul 25 '12 21:07

kender


1 Answers

You can do this:

xcodebuild -project "Your Project" -target "Your Scheme" -configuration Release

xcrun -sdk iphoneos PackageApplication -v "Some App.app" -o "Some App.ipa" --sign "iPhone Distribution: Your Signature\" --embed enterprise.mobileprovision

From a scripting standpoint with the enterprise distribution metadata plist, I create a template plist and then simply do string substitution to my target output location. You could get fancier and actually load the plist in the language of your choice and walk the structure to achieve what you want, but since there are only a couple of values to change I found it easier and quicker to just do a global string replace in the raw string of the plist then write it back out.

like image 157
d820m Avatar answered Oct 25 '22 15:10

d820m