Most of the clients I work with use Xcode to run a project for testing on their own system and devices. Clients can easily use Xcode to get the latest code updates straight from the Subversion (SVN) repository. This article is a guide for anyone working with developers on a Xcode project.
Downloading the Project
When you first load up Xcode, you’ll get the welcome screen. For our initial download process, or checkout, we need to tell Xcode about where to get the files for the project.
Click on “Connect to a repository” to get started.
On the next screen, we need to type in the location of the SVN repository. This will vary depending on where the server is hosted but your developer should give you this information.
Click “Next” when you’re finished.
For the name you can type anything that will help you remember the project name. Keep the type “Subversion” then click “Checkout”
A dialog will appear asking you were you’d like to save the folder where the files will be downloaded to. Click “Checkout” again to set the folder.
A username and password dialog should appear (unless your SVN repository allows guest checkouts). Type in this information, which also should have been given by your developer.
Click “OK” to continue.
At this point Xcode is downloading all of the files on the repository to the folder you specified. It might take a while depending on the size of your project.
When it’s completed you should see a message similar to this.
Click “Open Project” to load the newly downloaded project into Xcode.
Getting Changes From the SVN Repository
When developers make changes to the project they save (commit in SVN speak) the changes to the server. Any changes they save can be downloaded (updated in SVN speak) such that you have the latest and greatest build out there.
This is much more efficient than sending large zip files back and forth. It’s also easy to do since all of the hard setup stuff was in the first section above.
To get the latest update, highlight the top level of your Xcode project and right-click (or control+click) and select “Source Control -> Update Selected Files…”
Any updated files will automatically get downloaded. Just compile and test out the new changes! (You might have to select “Product -> Clean” before building)
Xcode 4 Fail
Depending on the situation, when you perform the last step, you might get this error message:
This appears to be an Xcode 4 bug as of Xcode 4.3, but thankfully there is a work-around.
In Xcode, select “Window -> Organizer” Then select “Repositories” at the top of the window.
In the left column find the repository settings you are currently using and select the folder under the “Root” folder. It should be the same name as the folder where your project is located; in my example it is “trunk“.
After you select the folder (called the “working copy” in SVN speak), click the “Update” button on the bottom. It should download any updates from the server.
After this finishes, you should see a message similar to this:
Go ahead and switch back to the main Xcode window and build the project with the new changes.
Version control makes developer’s lives easier by being able to track our code and changes. Clients can see a log of all the changes at their leisure and have direct access to the latest builds without having to send zip files back and forth.
If there is any confusion about any of these steps, please let me know in the comment section below. Thanks again for reading!