cocos2dx3.8 iOS Packaging script writing

Source: Internet
Author: User

Cocos Integrated Packaging commands Cocos compile-p iOS

Instead of applying this scenario here, write your own script for the following reasons

    1. Scripting in your own hands can be the first time to solve and find bugs
    2. 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

    1. Build/ios: Script directory,
    2. 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

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.