Continuous Integration in Xcode5

    In the fifth version of Xcode, Continuous Integration has appeared. It works through the Xcode OS X Server service ($ 20, AppStore ).

    Xcode Service can do the same as any Continuous Integration server, maybe a little less. A huge plus - full integration with Xcode and Apple-specific "work out of the box." I started auto-building the project in half an hour, although I had never set up a CI server before. And you do not need to smoke manuals how to properly assemble the application from the command line, how to turn on the emulator or run tests on the device.

    xcode continuos integration

    Xcode Service automation work is performed by bots . Bot
    • Picks up a project from GitHub or SVN.
    • Conducts statistical code analysis.
    • The project assembles, common circuits are used for selection , they are created through Xcode and stored in the repository.

    • Performs Unit tests, unit tests are also built into Xcode, tests can be performed on any device connected to the CI server and on any installed emulator.

    • Notifies of failed assembly or testing by anyone who has committed to the repository.

    The project build starts on time, manually or after each commit.

    Detailed installation instructions on the Apple website .

    Setup takes 30 minutes. I was very pleased that everything works out of the box and is integrated. Unit tests and bots are created in Xcode, there are beautiful reports on test execution and assembly.

    And a couple of useful recipes.

    Upload to Test Flight

    In the Archive section of the circuit, add something like this Post-Action
    -F file=${BUILD_ROOT}/Debug-iphoneos/${FULL_PRODUCT_NAME}
    -F api_token='your_api_token'
    -F team_token='your_team_token'
    -F notes='This build was uploaded via the upload API'
    -F notify=True
    -F distribution_lists='Internal, QA'

    UI testing

    Unfortunately, automated UI testing through the standard UIAutomation cannot be run on the build server (okay, you can , but java script and its glitches negate the advantages).

    I recommend UI testing through KIF . It is transparently integrated into the Xcode Test Navigator and executed by bots.

    Subscribe to our habr-blog . Every Thursday, useful articles on mobile development, marketing and the mobile studio business.

    Also popular now: