Lesson: Set up Xcode service

This lesson assumes you’re a developer, you have Xcode installed on a Mac, and you have a code repository (specifically a Git repository) already hosted somewhere.

In this lesson, you'll learn how to:

  • Set up Xcode service

  • Host a Git repository

  • Configure Xcode to interact with Xcode service

  • Create a nightly build bot

  • Check the bot’s output in the web app

Step 1. Download and install Xcode on the server

To use Xcode service, you must first install Xcode on the server, if it’s not already installed.

  • Download Xcode from the App Store and install it on the server.

Step 2. Use the Server app to configure Xcode service

  1. Open the Server app to see the list of services available in OS X Server. Select Xcode.

  2. Click the Choose Xcode button, then select Xcode in the Applications folder. Xcode service starts automatically.

    Arrow indicating Choose Xcode button

Step 3. Create a Git repository

Xcode service bots access projects and code from your source Git repository.

  • Click Repositories, then click the Add button add. Choose a name for the Git repository, and click create.

    The URL of the repository is based on the server host name and the repository name. For example, the URL for the repository would be https://myserver.example.com/git/Mac_Calc.git.

    Arrow indicating add repositories

If you have an existing Git repository, use Xcode to copy the files up to the newly hosted repository.

Step 4. Turn on the service.

  • Click the button to turn on Xcode service.

    Service switch turned on

Step 5. Open Xcode and add the server to the Accounts preference

Xcode 5 can connect to servers running Xcode service.

  • In Xcode preferences, click Accounts, then click the Add button add to add a server account.

    Then select the server and log in using your server account.

Step 6. Create a nightly build bot

Check out the project in Xcode, if you haven’t already done so.

You can also use Xcode service’s web app to create bots.

  1. In the project, make sure the Scheme you’re using is Shared.

    If it’s not shared, Xcode will offer to share it.

  2. Choose Product > Create Bot, then follow the onscreen instructions.

  3. Choose the scheme and the server (myserver.local in this tutorial). Enter a name for the bot (Mac_Calc Bot), then click Next.

  4. Enter authentication settings for your repository, if needed.

  5. Enter the schedule and action settings.

    Use one of the following schedule settings: Periodically, Daily, at midnight. Select only the Perform archive action.

  6. Enter email settings.

    Leave the failure email notification checkbox selected, and add your email address to the failure notification list.

  7. Click Create Bot.

Step 7. View the bot report in Safari

  • Open Safari, go to https://myserver.local/xcode/, then select the bot in the list of bots.

    Safari bots list page

Step 8. Run an integration in Xcode with the bot and view the results in Safari

  • In Xcode, start the integration action before the scheduled time by clicking the Integrate button.

Congratulations!

You’ve learned how to set up Xcode service, create a bot, and use Safari to monitor the bot’s progress.

Where to go from here

There’s still a lot to learn about software development and integration workflows. You can learn more about those and the Xcode app at the Apples Developer website.

You can learn more about continuous integration in the Xcode Continuous Integration Guide.

You can find out more about Xcode service in Server Help.

You might also want to learn how to access a private network securely over the Internet; see the Configure public access tutorial.