Use Python to write scripts for iOS project to automatically compile, package IPA, etc.

Source: Internet
Author: User

The first time you use Python, look first: http://my.oschina.net/LangZiAiFer/blog/298763

Code management I use Git;

The project clone is as follows:

def Gitclone ():

os.system (' git clone https://[email protected]/xxx/goccia.git ~/desktop/20140804 ')     

Return

Https://[email Protected]/xxx/goccia.git is a git server path without care;
~/desktop/20140804 is the target path, where to put it with you

Checkout as follows:

First: Enter the project storage path:cd/users/gbry/desktop/20140804

def gitcheckout ():

Os.system (' cd/users/gbry/desktop/20140804;git fetch && git checkout dev ')

return

Compile

def Build_debug ():

print "Build Debug Start"

Os.system (' xcodebuild-version ')

Os.system (' Xcodebuild-showsdks ')

Os.system (' xcodebuild-list ')

Os.system (' cd/users/gbry/desktop/20140804;xcodebuild-sdk iphoneos7.1 ')

return

See: http://www.cnblogs.com/xiaodao/archive/2012/03/01/2375609.html

Packaging IPA:

def Build_ipa ():


Os.system (' xcrun-sdk iphoneos packageapplication-v/users/gbry/desktop/20140804/build/release-iphoneos/ Goccia.app-o/users/gbry/desktop/goccia_%s.ipa '%time.strftime ('%y-%m-%d ', Time.localtime (Time.time ( ))))

return

See: http://www.devdiv.com/ios_-blog-1511-49991.html

then call the above function in turn:

Gitclone ()

Gitcheckout ()

Build_debug ()

Build_ipa ()

I would like to make a record of this, the great god please around ...

To be continued 、、、

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.