Batch Build and Archive of iOS apps via Terminal

后端 未结 2 1988
慢半拍i
慢半拍i 2021-02-06 04:53

I am trying to simplify the build->archive->submit process for iOS app publishing. We have over 50 mobile apps that have nearly identical framework, but with different artwork a

2条回答
  •  -上瘾入骨i
    2021-02-06 05:36

    OK I found a solution that will work. After doing a lot more searching and a lot of guess and check, I found I can still use the "archive" option with xcodebuild, I just have to specify a workspace and scheme and apparently I wasn't doing that correctly before as it now works.

    So, for anyone looking for a similar solution (to batch archive xcode projects), here is my function:

    # $mybase will be the current directory at the time the function was called
    # so make sure to cd into the folder containing the xcode project folders first
    
    function xcodeArchive {
        mybase=$PWD
        for x in `ls`
        do
            cd $mybase/$x
            xcodebuild -workspace $x.xcodeproj/project.xcworkspace -scheme $x archive
            cd $mybase
        done
    }
    export -f xcodeArchive
    

提交回复
热议问题