IOS projects are automatically released through xcodebuild and xcrun

Source: Internet
Author: User

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:

  1. Import key chain
  2. Clean Project
  3. Modify info Information
  4. Modify project information
  5. Xcodebuild
  6. Replace various resource files
  7. Modify xcent
  8. Re-sign codesign
  9. Xcrun ipa
  10. Delete a key chain

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.