Finally. It has happened to Xcode: Apple IDE gets hooked up to new CI/CD service

Finally. It has happened to Xcode: Apple IDE gets hooked up to new CI/CD service

Apple’s WWDC has come and gone, giving devs a new Xcode to plunge into and finally providing them with an integrated way to leap into a golden future of continuous delivery and parallel programming.

The company used the developer conference to push out a beta of its integrated development environment Xcode 13. The most interesting enhancement? Continuous integration and delivery service Xcode Cloud. 

According to Apple’s VP of Worldwide Developer Relations Susan Prescott, the still in-limited-beta service can be used to automatically build an app whenever a change is committed to its code.

 “Because it’s built in the cloud, your Mac is free for other tests. And for teams, everyone can see if the change introduces errors so everyone can find and fix issues faster.” Tests are run in parallel where possible to save time with results displayed directly in Xcode “so you can easily see what worked and fix what didn’t.”

Xcode Cloud also integrates with beta testing tool TestFlight, meaning that an app can be automatically released to internal and external testers once it passes all its tests. To be able to serve all Apple platforms, the company introduced TestFlight for Mac.

Since not everyone will like the idea of sharing their code with Apple, Prescott made sure to point out that “your source code is only used in a temporary build environment and the only things Xcode Cloud stores are the products of the build”.

Besides these additions Xcode includes reworked navigator icons, and an option to run tests until they either fail, pass, or have run a predefined number of times for data collection. It is also supposed to be faster with highlighting syntax and offering code completion when programming Swift apps. 

Speaking of Swift, version 5.5 is also part of the Xcode release and adds support for package collections and concurrency. The latter is amongst the most requested features for the programming language and is hoped to help developers take better advantage of multi-core processors. 

Parallel running code often isn’t the easiest to write, so Ted Kremenek, directorof Languages and Runtimes at Apple, took to the WWDC stage to convince devs that this won’t be the case with Swift. “We will structure concurrency deep into the Swift language and use the common async/await pattern, combined with a technology called actors. This means you can write code as a simple sequence of steps, with actors safely isolating parallel tasks from one another.”

In Swift, an actor is described as a reference type that protects access to its mutable state and can have initializers, methods, properties, and subscripts, much like other types. The isolation Kremenek mentions is enforced statically by the Swift compiler “through a set of limitations on the way in which actors and their instance members can be used”. 

Combined with the async/await approach chosen to implement concurrency, this should make for comparatively easy to read and write parallel programs. Developers interested in giving it a go and providing feedback before the beta phase is over, need to set the -Xfrontend -enable-experimental-concurrency flag.

But since the best app isn’t worth a thing when it can’t be found in the app store, devs can now provide different product pages geared towards different user groups and do A/B testing on app icons, screenshots, and app previews to optimise default pages. In-app purchase helper StoreKit 2 meanwhile “features new APIs for handling product entitlements and subscriber status, and testing support in both Xcode and the Apple sandbox environment”.

More niche updates include an easier way to capture 3D objects for augmented reality content in RealityKit as well as a variety of APIs and tools to create games with a higher visual impact.