IOS projects are automatically released through xcodebuild and xcrun
I recently studied automatic generation of apps. I used Python to write programs to replace icons, names, and so on, and then generated a brand new application.
Xcodebuild and xcrun commands are usually used for packaging. xcodebuild is responsible for compiling, and xcrun is responsible for converting the app into ipa.
Common steps are as follows:
1. Clean up the project
/Usr/bin/xcodebuild-target targetName clean
2. compile the project
/Usr/bin/xcodebuild-target targetName
3. Packaging
/Usr/bin/xcrun-sdk iphoneos PackageApplication-v path/To/xxx. app-o xxx. ipa
For a signed package, the preceding two Commands need to add some parameters.
Xcodebuild-target targetName CODE_SIGN_IDENTITY = "iPhone Distribution: XXXXXX"
Xcrun-sdk iphoneos PackageApplication-v source app path-o output ipa path -- sign "iPhone Distribution: XXXXXX"
Automatic packaging steps:
1. manually compile an App with xocde, assuming MyApp. app
2. Import the Certificate file to the MAC key chain
// Create a key chain
Security create-keychain-p myapp. keychain
// Unlock; otherwise, the rebound box is waiting for the password to be entered.
Security unlock-keychain-p myapp. keychain
// Import the certificate
Security import/opt/myapp. p12-k myapp. keychain-P mypassword-T/usr/bin/codesign
3. Use MyApp. app as the template, copy a backup, and replace various resources, such as replacing the image files of the application.
4. Replace the *. mobileprovision file with the MyApp. app directory.
5. Delete the signature information under MyApp. app _ CodeSignature
6. Change info. plist Bundle indentifier to be consistent with *. mobileprovision.
7. modify the application-identifiervalue value in MyApp. xcent to the corresponding certificate name. You can use an xcent as the template,Note that if the keyword aps-environment is absent, the output ipa package will not have the apns module.The format is as follows:
Application-identifier
Z4LR7CBRUD.com. yesun. vic
Aps-environment
Production
Get-task-allow
8. re-signed codesign
/Usr/bin/codesign -- force -- sign 9c8b212f6a2c2382847b%e387a01b246d4ce42 -- resource-rules = MyApp. app/ResourceRules. plist -- entitlements MyApp. xcent Mkey3G. app
9. generate an ipa package
/Usr/bin/xcrun-sdk iphoneos PackageApplication-v MyApp. app-o MyApp. ipa -- sign 9c8b212f6a2c2382847b424e387a01b246d4ce42 -- embed MyApp. app
10. delete a key chain
Security delete-keychain myapp. keychain
The packaging steps with xcodebuild compilation are as follows:
- Import key chain
- Clean Project
- Modify info Information
- Modify project information
- Xcodebuild
- Replace various resource files
- Modify xcent
- Re-sign codesign
- Xcrun ipa
- Delete a key chain