Use two main commands
Xcodebuild: Package The Xcode project into an. App file
Xcrun: Package the app as an. IPA file
The following is a well-written ant script:
1 <?XML version= "1.0" encoding= "UTF-8"?> 2 <Projectdefault= "Release"name= "Packageforios"Basedir=".">3 < Propertyname= "Xcodeprojectpath"value= "/users/xxx/documents/ios"/>4 < Propertyname= "AppPath"value= "${xcodeprojectpath}/build/xxx.app"/>5 < Propertyname= "Ipapath"value= "${xcodeprojectpath}/build/xxx.ipa"/>6 7 <!--Certificate -8 < Propertyname= "Sign"value= "IPhone developer:xxx"/>9 <!--description File -Ten < Propertyname= "provision"value= "Xxx.mobileprovision"/> One <!--Provisionuuid generated according to provision - A < Propertyname= "Provisionuuid"value= "5cdcxxxx-4295-xxxx-bb44-cb4c89ee4245"/> - - <Targetname= "Ipabuild"> the <execexecutable= "/bin/bash"dir= "${xcodeprojectpath}"> - <Argvalue= "-C"/> - <Argvalue= "Xcodebuild clean"/> - </exec> + - <Echomessage= "Generate: ${apppath}" /> + <execexecutable= "/bin/bash"dir= "${xcodeprojectpath}"> A <Argvalue= "-C"/> at <Argvalue= "Xcodebuild code_sign_identity= ' ${sign} ' Provisioning_profile=${provisionuuid}"/> - </exec> - - <Echomessage= "Generate: ${ipapath}" /> - <execexecutable= "/bin/bash"dir= "${xcodeprojectpath}"> - <Argvalue= "-C"/> in <Argvalue= "Xcrun-sdk iphoneos packageapplication-v ${apppath}-o ${ipapath}"/> - </exec> to </Target> + </Project>
Where Provisionuuid needs to be generated according to the description file *.mobileprovision, the generated code is as follows:
1 #!/bin/bash23#描述文件存放的位置 4 provision= 'pwd'/ Dev_provision3.mobileprovision5#获取UUID6'print:uuid ' /dev/stdin <<< $ (Security cms-d-i ${provision}) '7Echo Provisionuuid
Xcode Project command line generates an IPA installation package