Build/run iOS Xcode project from Terminal

后端 未结 1 1344
死守一世寂寞
死守一世寂寞 2020-12-13 19:23

I want to build a Xcode project from Terminal and then run it as required, also from Terminal.

I have been looking for a way to do this for a while now but only mana

相关标签:
1条回答
  • 2020-12-13 19:43

    To build your xcode project from the command line using a bash script use:

    /usr/bin/xcodebuild -target TargetYouWantToBuild -configuration Debug
    

    Look at the man page for xcodebuild for more options.

    We do this for our unit test suite target, and we use GHUnit.

    This is the section of our build script for running the tests:

    export GHUNIT_CLI=1
    export WRITE_JUNIT_XML=1
    clean
    echo "Building Bamboo GHUnit Tests..."
    OUTPUT=`/usr/bin/xcodebuild -target BambooAutomatedUnitTest -configuration Debug -sdk iphonesimulator4.3 build`
    RESULT=`echo "$OUTPUT" | grep "\\*\\* BUILD "`
    if [ "$RESULT" != "** BUILD SUCCEEDED **" ]
    then
        echo "$OUTPUT"
        exit 1
    fi
    echo "${RESULT}\n"
    
    0 讨论(0)
提交回复
热议问题