iOS projects are automatically released via Xcodebuild and Xcrun

Source: Internet
Author: User

Recently in the study of automatic generation of apps, use Python to write programs to replace icons, names, etc., and then create new apps.

Usually packaged with Xcodebuild and Xcrun two commands, Xcodebuild is responsible for compiling, Xcrun is responsible for the app into IPA.

The following are common steps:

1. Clean-up Works

/usr/bin/xcodebuild-target TargetName Clean

2. Compiling project

/usr/bin/xcodebuild-target TargetName

3. Packing

/USR/BIN/XCRUN-SDK Iphoneos packageapplication-v Path/to/xxx.app-o Xxx.ipa

If it is a package with a signature, the above 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, first use XOCDE manually compiled good one app, assuming that the Myapp.app

2. Import the certificate file into the key chain of the Mac

Create key Chains

Security create-keychain-p MyApp Myapp.keychain

Unlock, or the bounce box waits for the password to be entered

Security unlock-keychain-p MyApp Myapp.keychain

Import Certificate

Security Import/opt/myapp.p12-k myapp.keychain-p mypassword-t/usr/bin/codesign

3, to Myapp.app as a template, copy a backup, and then to replace the various resources, such as the replacement of the application of image files, etc.

4, replace the corresponding *.mobileprovision file to the Myapp.app directory

5, delete the signature information under Myapp.app _codesignature

6, modify Info.plist Bundle indentifier and *.mobileprovision consistent

7, modify myapp.xcent application-identifiervalue value for the corresponding certificate name, you can use a xcent as a template, Note If there is no aps-environment keyword, the calling out of the IPA package will not have APNs module , in the following format:


<? XML version= "1.0" encoding= "UTF-8" ?>

<! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd " >

< plist version = "1.0" >

< Dict >

<key>application-identifier</ key >

<string>Z4LR7CBRUD.com.yesun.vic </ String>

<key>aps-environment</key >

<string>production</string>

<key>get-task-allow</key >

<false/>

</ Dict >

</ plist >


8. Re-signed Codesign

/usr/bin/codesign--force--sign 9c8b212f6a2c2382847b104e387a01b246d4ce42--resource-rules=myapp.app/ Resourcerules.plist--entitlements myapp.xcent Mkey3g.app

9. Generate IPA Package

/USR/BIN/XCRUN-SDK Iphoneos packageapplication-v myapp.app-o myapp.ipa--sign 9c8b212f6a2c2382847b104e387a01b246d4ce --embed myapp.app/embed.mobileprovision

10. Delete Key Chain

Security Delete-keychain Myapp.keychain

The package steps with Xcodebuild compilation are as follows:

    1. Import Key Chain
    2. On the project clean
    3. Modify Info Info
    4. Modify project information
    5. Xcodebuild
    6. Replace various resource files
    7. Modify Xcent
    8. Re-signing Codesign
    9. Xcrun Play IPA
    10. Delete Key Chain

iOS projects are automatically released via Xcodebuild and Xcrun

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.