Well, you’re an Android developer and wondering if you should make the move to the Apple Silicon platform for your next setup… Maybe you’ll find something interesting below!

TL;DR

In a few words, and if you’re ready to dive into a bit of configuration: you really should consider the Silicon architecture! It’s powerful, energy saving and considering the Apple Intel lineup, it’s also really cheaper…

The platform

I won’t write too much here, just remember that during WWDC 2020, Apple made the announcement that starting 2020 and for two years, they will transition to their new computing architecture: they decided to replace Intel x86 chips with their own ones, based on the work they already did with the iPhones & other devices. On these devices, this meant lower energy consumption & higher performance, but they had in their hands the whole app ecosystem, which isn’t the same on computers.

But.

Yep, if you’re older, you’d remember that they already did a similar move: moving from PowerPC to… Intel x86 ahah. At this time, they used Rosetta, which works like a translator for software from one architecture to another. And they just did the same here with Big Sur by creating Rosetta2 to help editors make the move.

Model choice

If you’re a software developer, for sure you will consider the Macbook Pro as a first choice. In my case, I was in the urge for a new computer and hoped that Apple would release M1X or M2 models during WWDC, but they didn’t! So I’ve decided to give it a try and took a refurbished Air (16GB of RAM) to go with a cheaper model. In fact, there’s only two things that differ between the Pro & Air models:

  • the battery, which is slightly bigger on the Pro
  • fans: the Air doesn’t have any, so it’s gonna be silent (which seems to be great after my previous tornado!)

Everyday use

Well, in short, almost every app that you’re gonna use works straight out of the box, Rosetta works pretty well and you probably won’t notice any difference with an Intel computer. The main place where you’ll have to dig a bit is to improve running Android stuff…

Android Dev

As an Android dev, you’ll probably just install Android Studio by downloading it on the Android dev website (or maybe brew install it to speed up things), and use the embedded JDK. Well, here you’re gonna have to proceed a bit differently:

  • first, download the Azul JDK which is Silicon compliant here (versions 1.8 or 11 works well but you’ll need the 11 if you want to run Gradle 7.x)
  • setup your JAVA_HOME variable to target the right JDK
export JAVA_HOME="/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home"
  • then download and install AS Beta (Arctic Fox) from the archive (1)
  • when running AS the first time, choose as the default JDK the one matching your JAVA_HOME variable (it will then use it for all of your projects)

To be sure that you’re now running the right Silicon tools, you just have to open your activity monitor and check that Kind is now Apple and not Intel:

Performance

Having run a few benchmarks to compare the two setups, I can clearly assure that the M1 is really, really better than the Intel CPU that I used to run: almost every build is now 2 times faster.

  • big apps from ~2minutes to 1
  • small POC from 20seconds to 8

What is really astonishing is that I’m now able to run AS and an emulator without having a really hot laptop, without draining my battery in 1 hour (now 1h is only about 6-8%), and in pure silence… that’s really nice if you want to work anywhere in calm.

Issues

To be honest, I didn’t have too many! Once following these steps, everything works great but here are a few tricks that might help:

  • the first one is if you’re using Room, you’ll need to add the sqlite-jdbc dependency:
  • then if you want to be sure that your project runs the right version of Java - this setup moves in almost every version of AS - you’ll find the infos that you want here:

notes

Cover photo by Antonio Scalogna on Unsplash

  1. Reminder: Android Studio is based on Jetbrains IntelliJ IDEA, but with a certain delay between releases. Jetbrains released their Silicon optimized IDE at the end of 2020 - 2020.3.1 - and Android Studio Arctic Fox is the first release built on top of it.