To summarize, there are several ways to convert the app package to an. IPA package:
1, Apple recommended way, that is, practical xcode archive function
Xcode menu bar->product->archive-> Three, generally choose the latter two.
Limitations: This approach is generally used in personal development, but it is a bit cumbersome when a certificate is used by multiple people. General multiplayer development is the use of provisioning PROFILE+P12 files for real-machine debugging. The above method will need to input appleid when exporting the IPA package at the end, but also to other people in the team. The use of provisioning PROFILE+P12 real-Machine debugging method does not require developers to know AppleID and password, the password is generally placed in leader there;
2. itunes drag-in (recommended)
This method is very convenient. For specific steps, see the dynamic diagram:
Note: The "my App" in itunes refers to a program on a computer that does not require online and can be removed from the app.
3. Automatic compilation of scripts
It is also fast to write a fully automated compilation script that can be packaged without having to open the Xcode compilation run. Interested can read this article.
Cons: Not wrong OK, once there are grammatical errors or other errors appear is not good to deal with
Operation:
1) Required statements (can be executed directly on the command line)
xcodebuild-configuration Release
go to the root folder of your project and execute the above statement to start using release mode to build the project file automatically.
Note: The file must have a certificate added.
Mkdir-p ipa/payloadcp-r/release-iphoneos/product_name.app ./IPA/PAYLOADCD ipazip-r $FILE _name *
Enter the folder where the generated app file is located and execute the above statement to package the app file as an IPA file.
Note: The app file can be directly imported into itunes, but without icon, just put the icon in the./ipa folder and package it together.
app file default build Path (modifiable):
Xcode3: Project root directory /build/debug-iphoneos/product _name
Xcode4 and later :./user/<current user>/library/developer/xcode/deriveddata/<p roject name>-<other character>/build/products under:debug-iphoneos and Release-iphoneos and debug-iphonesimulator
icon requirements:
Not much more than 500*500 .
Format is jpg
Named itunesartwork
Cannot have suffix
2) script notation (mac/linux)
Script Format
#!/bin/shmkdir-p ipa/payloadcp-r/release-iphoneos/product_name.app ./IPA/PAYLOADCD ipazip-r $FILE _name *exit 0
Script Creation Method
Open Terminal
vim file_name.sh
Press "I" to enter edit mode, enter the contents of the script, press "ESC" to exit the edit mode, and press "ZZ" (uppercase) to save and exit.
About permissions
Use ls-l to view the permissions for files and folders in the current directory.
Change the permissions here to 777 chmod 777 file_name
Then rename it to. IPA
MV Xx.zip Xx.ipa
4. Unzip and modify the suffix name (recommended in this article)
This is done on the basis of the. App package generated by Xcode compilation, and the IPA contract is implemented by simply compressing and modifying the suffix name.
In this way, the script can be automated processing and manual processing of two ways to implement, recommended scripting methods, once and for all.
4.1 Script automatically generate IPA package
STEP1: Create a new folder named "Distribute" and create a new distribute.sh script file with: (Note that all appname in the script should be replaced by your real app name)
RM-RF appnamemkdir appnamemkdir appname/payloadcp-r appname.app APPNAME/PAYLOAD/APPNAME.APPCP Icon.png appName/ ITUNESARTWORKCD appnamezip-r Appname.ipa Payload itunesartworkexit 0
STEP2: Put the. app file that will be converted into the distribute/folder
The folder directory structure is as follows: (Note that all appname in the script should be replaced by your real app name)
Distribute/distribute.shdistribute/appname.app
STEP3: Run distribute.sh Script
Open the TERMINAL,CD to the Distribute folder and pull the distribute.sh into the terminal to execute. If you are prompted for permission denied, use the chmod 777 distribute.sh command to grant the permission, and then perform the distribute.sh again.
STEP4: After about a few seconds, the appname/folder is generated under the distribute/folder, and the Appname.ipa is the package we want.
4.2 Manual Compression Change suffix method
This approach is essentially the same as the 4.1 approach.
STEP1: New "Payload" folder, pay attention to the name of the word is not bad;
STEP2: Put your. App package into Payload, notice that the app's name doesn't make any changes, just use Xcode to generate the app name;
STEP3: Right-click on the payload folder to zip and then change the resulting. zip file suffix to. IPA
Four practical ways to pack an IPA in iOS (. App goto. IPA)