Chapter 9. Improving Your Code with Xcode Server and LLDB Debugging

One of the biggest skills you can learn to improve in your code is by learning how to test it. Adding unit tests to your code with the XCTest Testing framework will help you improve the quality of your code and will provide a secondary benefit of documenting how your code works. As you move from solo developer projects to multi-member teams, it becomes harder to maintain tests that are written in isolation. Automated testing, added to a continuous integration pipeline on a server, helps to address these pain points in the same way that source repositories help to manage code over larger projects.

In the first part of this chapter, we will cover Xcode Server's capabilities as a continuous integration server and how automated testing can be included to improve your testing workflow. In the second half, we will describe how to use LLDB for debugging your code on Linux.

Using server-based testing has several benefits that could justify the time investment for your team. If you're on the fence about whether going this route works for your team, make sure to consider the following in your evaluations:

A continuous integration workflow is a process that starts with developing locally on a development machine and then checking your code into a repository. Next, you migrate your project to Xcode server for processing. In order for Xcode Server to process your code, you have to provide it with some instructions in the form of bots. On your development box, you create bots with your processing rules that run on Xcode Server. The execution of a bot is called an integration, which can be run manually or according to a schedule. Once an integration finishes, the activity is reported back to your development Mac.