iOS自動(dòng)化打包

開發(fā)過(guò)程中,總免不了為測(cè)試打包,過(guò)程重復(fù)且耗費(fèi)時(shí)間,所幸,可以選擇自動(dòng)化打包

xcodebuild

xcodebuild 是蘋果發(fā)布自動(dòng)構(gòu)建的工具,

xcodebuild -h

       xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild [-project <projectname>] -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -workspace <workspacename> -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
       xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]] [-json]
       xcodebuild -showsdks
       xcodebuild -exportArchive -archivePath <xcarchivepath> -exportPath <destinationpath> -exportOptionsPlist <plistpath>
       xcodebuild -exportLocalizations -localizationPath <path> -project <projectname> [-exportLanguage <targetlanguage>...]
       xcodebuild -importLocalizations -localizationPath <path> -project <projectname>

前三條命令是比較常用的

xcodebuild -list

xcodebuild -list:lists the targets and configurations in a project, or the schemes in a workspace
定位到工程目錄下,執(zhí)行 xcodebuild -list,以我的工程為例,輸出如下:

?  SAUserModuleTest git:(master) ? xcodebuild -list
Information about project "SAUserModuleTest":
    Targets:
        SAUserModuleEnterprise
        SAUserModuleCompany

    Build Configurations:
        Dev
        Debug
        Cit
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    Schemes:
        SAUserModuleTest
        SAUserModuleEnterprise
        SAUserModuleCompany

編譯

我的工程中使用了cocoapods,因此在編譯時(shí)使用了 -workspace,并指定所需要build的 Configuration 和 Scheme,如下:

xcodebuild -workspace SAUserModuleTest.xcworkspace -configuration Cit -scheme SAUserModuleEnterprise
編譯過(guò)程中會(huì)打印諸多編譯信息,不出錯(cuò)的話基本沒(méi)必要看所打印的信息(太多啦),下面展示一張出錯(cuò)的圖:

build_failed.png

改錯(cuò),再來(lái)一遍!Again?。?!

Build_Success.png

Success!??!

libimobiledevice

官方github地址:https://github.com/libimobiledevice/libimobiledevice


未完,待續(xù)~~

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容