Amazon has recently unveiled that its managed build service, AWS CodeBuild, now supports building applications on macOS. However, because of Apple’s licensing stipulations, developers are required to have a dedicated macOS fleet in order to use this feature.
For building, testing, signing, and distributing applications across Apple’s platforms such as iOS, iPadOS, watchOS, tvOS, and macOS, the use of Xcode is mandatory. This tool is only operable on macOS. While running CI/CD pipelines on Mac instances was always feasible, the management and automation of macOS machines have historically been challenging. Sébastien Stormacq, Principal Developer Advocate at AWS, explains:
The initial step involves setting up the Amazon Machine Image (AMI) with all necessary tools for the build. This setup commonly requires Xcode at a minimum, but frequently includes Fastlane (along with Ruby) and other essential development tools and libraries. Different configurations of macOS and Xcode versions are often needed by many organizations.
As a continuous integration service AWS CodeBuild provides pre-configured build environments for several popular programming languages and tools like Apache Maven and Gradle. It handles compiling source code, running unit tests, and generating artifacts. The revised CodeBuild images for Mac builds are equipped with pre-installed macOS and Xcode, and support a range of tools and frameworks, including Java, Kotlin, Node.js, Python, Ruby, Rust, and Swift.
CodeBuild for macOS takes advantage of reserved fleets, using the reserved capacity feature launched earlier this year, which is tailored for latency-sensitive building and testing scenarios. The service performs builds on Apple M2 instances equipped with macOS 14 Sonoma. Stormacq details the second significant challenge tackled by Mac builds on AWS CodeBuild:
Large organizations often conduct hundreds or thousands of builds daily, necessitating numerous build machines. The ability to scale these fleets in and out is cost-effective. EC2 Mac instances are exclusively reserved for your use, with one instance designated per dedicated host. Scaling a fleet of dedicated hosts necessitates a specific setup.
Contrary to on-demand fleets that charge per minute of build time, reserved fleets incur charges for the full duration the build machines are exclusively reserved, even when no builds occur. This reservation aligns with Amazon EC2 Mac’s 24-hour minimum booking period, as demanded by the SLA for macOS. Piero Bozzolo, a cloud engineer and serverless developer at Claranet, remarks:
For teams or developers experiencing low build frequencies (only a few dozen builds a month), this model may not be economically viable. It is hoped that Apple will reconsider and eliminate the 24-hour minimum lease for their operating systems.
As outlined in the AWS documentation, setting up an EC2 Mac instance generally requires between 8 to 10 minutes. This setup time is not exclusive to CodeBuild, hence any build jobs initiated while the instance is still being prepared will be placed in a queue. These queued builds will then be executed sequentially once the instance is ready.
Currently, Mac instances for builds are limited to five specific regions: Ohio, Northern Virginia, Oregon, Frankfurt, and Sydney.
Welcome to DediRock, your trusted partner in high-performance hosting solutions. At DediRock, we specialize in providing dedicated servers, VPS hosting, and cloud services tailored to meet the unique needs of businesses and individuals alike. Our mission is to deliver reliable, scalable, and secure hosting solutions that empower our clients to achieve their digital goals. With a commitment to exceptional customer support, cutting-edge technology, and robust infrastructure, DediRock stands out as a leader in the hosting industry. Join us and experience the difference that dedicated service and unwavering reliability can make for your online presence. Launch our website.