Apple Silicon — Ready for developers?
Recently I switched from ubuntu to macOS Big Sur powered by Apple’s very own M1 chip which is quite good in terms of performance(that’s what I read over the Internet). I am new to macOS and did some research, played around, getting to know the directory locations and man it was fun(I skipped my Sunday afternoon sleep!) and here is a small attempt to collage my findings and things that I learned so far which might help speed up your development setup.
Should I buy the M1 or should I stick to Intel processor?
M1 is the first generation computers of all upcoming apple computers which claims to have better performance as compared to the previous processors. So as all upcoming macs will be powered by apple chips, many or I should say almost all applications will be modifying themselves to support the new chip. From a development point of view, I checked the list of macOS apps optimized for M1 apple silicon macs with 3 simple flags as shown in the below image, and all that I need were supported which made me clear about my selection. So according to me(if you are a developer), checking the list should be your first step.

Rosetta 2
What if I want to run apps that are not yet supported?
Apple introduced Rosetta 2 which acts as a bridge between intel supported apps and apple silicon. In simple words — ‘Rosetta is a translation process that allows users to run apps that contain x86_64
instructions on Apple silicon.’ It is super easy to install Rosetta 2 as it doesn’t come pre-installed in the M1s.
Installing Rosetta 2 —
/usr/sbin/softwareupdate - install-rosettaor, if you are lazy like me /usr/sbin/softwareupdate — install-rosetta agree-to-license (root permission required)
And you can use Rosetta now.
Using different terminal for Rosetta
It's better to configure two different terminals for the apps to be installed for M1 and the other for intel chip just to keep things simple. Using two terminals is old school and there is a way to avoid a second terminal which I will talk about later in the article.
- In Finder, search for utilities and duplicate the terminal(for iTerm users, you can follow the same process just confirm once over the internet).
- Rename the terminal to differentiate it from the original one, I renamed it as ‘Rosetta-terminal’
- Right-click and select ‘Get info’.
- Check the checkbox saying ‘Open using Rosetta’

You can use this terminal similar as other one and you can check by entering
archOutput for Rosetta-terminal - i386
Output for terminal - arm64
Homebrew
Now what is this?
Ubuntu users must be familer with ‘apt’ which is a package manager to make our lives easy. Simialrly Homebrew is — ‘The Missing Package Manager for macOS (or Linux)’. Homebrew installs stuff you need.
Installing homebrew is simple enough, but here is the twist -
Homebrew installtion path for M1s — '/opt/homebrew/bin/brew'
Homebrew installtion path for intel chips - '/usr/local/bin/brew'
The two locations live independently of one another: /usr/local for rosetta-emulated (Intel) code and /opt/homebrew for ARM64. These are somewhat hardcoded locations for Homebrew and there is not much we can do about it.
Installation command is same for both chips -
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Now the insteresting part, to avoid using the different terminals(and to not loose fun), Rosetta gives us the ability to prefix commands with the arch -x86_64
prefix to run applications in the emulated mode. And this solves our problems! Which means -
- use
arch -x86_64
prefix for using intel based apps - use
arch arm64e
prefix for M1 based apps
This easy, for example, to install apps from brew package manager for intel as well as M1 based macs —
Homebrew for intel arch -
arch -x86_64 /usr/local/homebrew/bin/brew install <package name>Homebrew for M1 mac -
/opt/homebrew/bin/brew install <package name>
To make things even simple, you can create alias, I am using -
- ibrew=’arch -x86_64 /usr/local/bin/brew’
- mbrew=’arch -arm64e /opt/homebrew/bin/brew’
So I just use, ibrew install and mbrew install to install apps
Now, how to create an alias? Refer this.
My experience from ubuntu 18.04 to macOS Big Sur
Its amazing! No hicups, no slowing down, great hardware.
Hope the article was helpful. I will be playing around and posting more similar ones. Cheers :)