Cocos Integrated Packaging commands Cocos compile-p iOS
Instead of applying this scenario here, write your own script for the following reasons
- Scripting in your own hands can be the first time to solve and find bugs
- There will always be a variety of customized requirements for the game, and it is impossible for the official to give all the solutions.
Checked the data. Xcode Support Command line
Xcodebuild: Compiling Xcode project Build app file
Xcrun: Converting an app file to an IPA file
If not clear, direct command line xcodebuild-help to view all commands
For ease of administration and expansion there are two new folders created here
- Build/ios: Script directory,
- Publish/ios:ipa Output Directory
Directly on the script, the XXXX into its own certificate file and project path can be
#!/bin/bashschemename= "$" outputpath= "$" dir= "$ (CD" $ (dirname "${bash_source[0]}") "&& pwd)" CD $ Dircertidentity= "XXXXXXX" profile= "XXXXXX" ios_sdk=iphoneos8.4projectpath= "${dir}/". /.. /frameworks/runtime-src/proj.ios_mac/xxxx.xcodeproj "if [!-D" ${outputpath} "]; Then mkdir-p "${outputpath}" Fi#xcodebuild-project $projectPath-scheme ${schemename}-sdk ${ios_sdk}- Configuration Release cleanxcodebuild-project "$projectPath"-scheme ${schemename}-sdk ${ios_sdk}-configuration Release deployment_postprocessing=yes configuration_build_dir= "${outputpath}" code_sign_identity= "${CertIdentity} "Provisioning_profile=" ${profile} "buildxcrun-sdk Iphoneos packageapplication-v" ${outputpath}/${schemename}.app "- O "${outputpath}/${schemename}.ipa"
We'll write a Python script to call the shell and pass the scheme and Outpath parameters.
#-*-coding:utf-8-*-ImportOSImportdatetimeclassBuildios:def __init__(self): Self.dir= Os.path.split (Os.path.realpath (__file__)) [0] Self.outputpath= Self.dir +"/.. /.. /publish/ios"Self.schemename="XXXXXXX" defBuild (self): Os.system ("SH build_ios.sh"+ Self.schemename +" "+self.outputpath) Fileprefix= Self.outputpath +"/"+Self.schemename#Get current Timenow =Datetime.datetime.now ()#convert to the specified format:Otherstyletime = Now.strftime ("%y%m%d%h%m") Os.rename (Fileprefix+". IPA", Fileprefix +"_"+ Otherstyletime +". IPA") defRun (self): Os.chdir (Os.path.split (Os.path.realpath (__file__) ) [0]) Self.build () Buildios=Buildios () buildios.run ( )
In the future we can continue to improve the python, such as in different platforms pre-folder collation, before executing the packaging script to compile the LUA into bytecode and encryption, enjoy the imagination!
cocos2dx3.8 iOS Packaging script writing