June 27, 2018 | Swift, Unit Testing, Scripting, iOS, macOS, tvOS, watchOS
In the last tutorial, we saw how to generate code coverage reports using the new `xccov` tool. Part of that process is using the `xcodebuild` command to build a project with code coverage enabled. We ran that command directly in Terminal, but we could also run `xcodebuild` in a Swift script. The problem is `xcodebuild` takes time, and . . .
June 21, 2018 | Swift, Unit Testing, Scripting, iOS, macOS, tvOS, watchOS
With the release of Xcode 9.3, Apple included a new command line tool called "xccov". It can be used to view code coverage reports as JSON, which can then be used to automate code coverage workflows. In this tutorial we'll see how to generate and view code coverage reports. We'll then write a Swift script to process the report.
July 20, 2017 | Swift, Scripting
In this tutorial we'll increment the version number of a Xcode single view application using a Swift script. We'll cover how to make the script executable, accept command line input, and execute shell commands from our Swift file.
August 23, 2016 | Swift, Scripting
I've made several frameworks and found myself going through the same process every time I wanted to update one of them to a new version. After finishing the code updates, I would increment the version number for each target (iOS, macOS, tvOS), update the version in the corresponding Podspec file, commit the version update . . .