用python編寫ios工程自動編譯、打包ipa等指令碼

來源:互聯網
上載者:User

標籤:des   style   blog   http   color   使用   os   io   

第一次使用python請先看:http://my.oschina.net/LangZiAiFer/blog/298763

代碼管理我用的是Git;

工程clone如下:

def gitClone():

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

return

https://[email protected]/xxx/goccia.git是git伺服器路徑,不必care;
~/desktop/20140804是目標路徑,放哪兒隨你

checkout如下:

首先:進入工程存放路徑:cd /Users/gbry/Desktop/20140804

def gitCheckout():

    os.system (‘cd /Users/gbry/Desktop/20140804;git fetch && git checkout dev‘)

    return

編譯

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

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

打包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

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

然後依次調用以上函數:

gitClone()

gitCheckout()

build_debug()

build_ipa()

謹以此做記錄,大神請繞。。。

未完待續、、、

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.