Setting up a Mac Again

Featured image

I’ve just installed macOS Big Sur and I’ve decided to reinstall from scratch rather than just upgrade. Unlocking System Preferences and any auth involving my Apple Watch or Touch ID were very slow and reinstalling from scratch seems to have fixed that.

This means I need to set up my Mac again for Xcode development, specifically for Drive Player.

Fastlane

I use Fastlane to automate some of the building and deployment of Drive Player to the App Store. To set it up again I basically used the instructions here. This also meant installing homebrew again.

Can’t find Xcode

I installed Fastlane and was all ready to. I attempted to run the tests1 for my app and then…

[!] Unable to locate Xcode. Please make sure to have Xcode installed on your machine

I definitly have Xcode installed as it’s currently running a build on my iPhone. A quick Google search turned up this solution.

sudo xcode-select -switch 

Which fixed the issue for me.

Swiftlint

On to the next problem. I have Swiftlint check that my code looks good and fails the build if it detects errors. I’d forgotten to install Swiftlint.

[!] You have to install swiftlint using `brew install swiftlint` or specify the executable path with the `:executable` option.

An upside to this failing was that I realised I was running swiftlint after I was building the app. Obviously this wastes a lot of time if I’m just going to fail the build due to a linting error. I readjusted to run swiftlint before the build.

Success

[16:05:51]: ▸ Done linting! Found 0 violations, 0 serious in 36 files.
...
[16:06:09]: fastlane.tools finished successfully 🎉

Excellent.

GitHub Runner

I use GitHub actions to automate my build and deployment. Because I haven’t yet worked out which certificates I would need to upload to GitHub to make a remote worker work, I run the GitHub runner locally under my own account.

Getting this set up was simple and I didn’t have any problems getting it to work.

It All Works

After those couple of changes and installations I was up and going. Stay tuned for version 1.2 of Drive Player which includes a WatchOS companion app.


  1. bundle exec fastlane ios test ↩︎