First install the normal packaging process Archive to generate the folder shown in Figure 1, take out the ExportOptions.plist file inside and put it on the desktop (you don't need to repeat this step in the future, just save the ExportOptions.plist file)
Then download the automated packaging script
Link: https://pan.baidu.com/s/1fP88KVrfLn72a_w1GDguqQ
Extraction code: kpu7
Put the script into the project , as shown in Figure 2
Then open the script, you will see the following code
xcodebuild clean -workspace youProjectsName.xcworkspace -scheme youProjectsName -configuration enterprise
xcodebuild archive -workspace youProjectsName.xcworkspace -scheme youProjectsName -archivePath /Users/j/Desktop/youProjectsName/youProjectsName.xcarchive
xcodebuild -exportArchive -archivePath "/Users/j/Desktop/youProjectsName/youProjectsName.xcarchive" -exportPath /Users/j/Desktop/ -exportOptionsPlist /Users/j/Desktop/ExportOptions.plist
Replace all "youProjectsName" in it with " your project name ";
Replace the " /Users/j/D esktop/youProjectsName / youProjectsName.xcarchive" inside with the project path. The project path written here is on the desktop and can be replaced with the corresponding one;
Replace /Users/j/Desktop/ -exportOptionsPlist /Users/j/Desktop/ ExportOptions.plist with the path of your ExportOptions.plist file. The file path written here is on the desktop and can be replaced with the corresponding (note "- "exportOptionsPlist" has a space on the left and right sides);
Then save and close the script file.
Finally, open the terminal, cd to the project directory, and press Enter;
Then enter ./autoArchive.sh and press Enter, and the .ipa file will be generated in the corresponding directory.
As shown in Figure 3:
There may be permission issues here, as shown in Figure 4
solution:
$ sudo chmod -R 777 /Users/j/Desktop/youProjectsName
777 is the highest authority for all users
-R refers to the cascade application to all subdirectories and files in the directory
Then execute " ./autoArchive.sh " again, and find me unsuccessfully!
In the future, you only need to perform the three steps in the figure
That's it! ! !