Configuring MacOS for iOS development

What do you need to start developing an iOS application for the first time on your brand new Mac? In this short article I will try to describe what I do to make sure I will not have to interrupt my development cause of some missing configuration.

Xcode

Of course, we cannot forget about Xcode. Some people might prefer using AppCode from JetBrains but sooner or later Apple’s IDE and tools that are installed with it will be required anyway. You can get it from the AppStore but depending on what you are developing (or how close to release is your app) you might want to download an older version(s) of Xcode from here — you do not need a Paid Developer Account 😉. An older version of Xcode is usually required when your app is in the stabilization phase and switching to the newest version of Xcode at this point might break something so better stick to the version on which your app was already tested (unless you have decent tests written then you can switch to new Xcode more easily).

Visual Studio Code

My preferred editing app for anything that I do not edit in Xcode, like formatting JSON/XML, writing bash scripts etc. I also use that for Flutter development — for that, you just need a Flutter plugin as mentioned in the Flutter’s “Getting Started” guide.

SourceTree

For git related stuff I usually use either command line tool or SourceTree. Cannot really say more about that, you either like that or not 🙂.

Homebrew

It is a package manager and most likely you will need that to install a few packages/apps at some point. You can skip that at the beginning your journey with iOS development though.

Bundler

What is a Bundler?

Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.

It is quite essential for projects that use CI/CD (continuous integration/delivery systems) since all (gems) dependencies will be synced and you will be sure that if your build works on your machine it will (should) work the same on other machines as well. Also when new a guy joins the projects it is way easier to just download all project’s (gems) dependencies with one simple command instead installing all of then “one by one”… and not forgetting about the correct versions. And I strongly suggest installing and using it. Although, once you try to install it with gem install bundlercommand it might fail with the permissions error. If you google it there will be a few suggestions on how to fix that (like simply using a sudo but do we really want to do that?). I prefer the other way, modify your .bash_profilefile and add those lines:

export GEM_HOME=”$HOME/.gem”
export PATH=”$GEM_HOME/bin:$PATH”

and the permissions issue should be gone. It just modifies the gem’s home path and sets it to a folder in your HOME folder so you have a permission to that and it won’t override gems with other mac’s users.

CocoaPods

Probably the most popular dependencies (pods) manager for iOS/MacOS development. There is a huge base of pods and it just makes it really easy to use. The only downside is that its release cycle is quite slow and it might not always be up to date with the latest changes in the Xcode. Anyway usually the open source projects use it (and a lot of commercials as well most likely) so you will need it sooner or later.

Fastlane

If you work in a larger group in one project and/or use CI/CD it helps a lot to sync app testing and it’s release process. Although recently Apple opened their App Store Connect API so soon there might show up some simpler apps/scripts to do the job. Might want to keep an eye on that since a Fastlane is quite heavy and most likely you won’t ever use most of its features. Personally, I prefer to ditch anything that is redundant to me.

SwiftLint

A tool to enforce Swift style and conventions, loosely based on GitHub’s Swift Style Guide.

In my opinion, it’s pretty much a must-have if you want to follow a common style guide between people in the same project. It also helps to avoid some common mistakes and enforces using good practices. You can either install using mentioned earlier Homebrew or use a CocoaPods to add it as a pod to the project (do not have to link it with any target). There is also one more option to — move executable to the repository. Which way to prefer? Discuss with your team and choose what suits you best. The CocoaPods or the last mentioned option seems the best since the version of SwiftLint will be synced between people.

Conclusion

Configuring MacOS for an iOS development is quite straightforward and all you need to make your first app is just an Xcode.

What about you, fellow iOS developers? What do you usually install/configure before starting development on your fresh MacOS?