Macbook Air M1 Android Emulator

November 24, 2020

I’ve never been a Mac guy.

My main gripe with Apple is that every Mac they release has a processor that’s about a generation behind. Then they have the audacity to charge the Apple tax. You typically pay 3x for a Mac what you’d pay for a PC with the exact same hardware.

Enter the M1 Mac Mini, Macbook Air, and Macbook Pro. These are entry-level Mac products that price/performance wise are actually semi-competitive with Windows machines at the same price-point. OK Apple, I’m listening.

But, can it run XCode quickly?

The M1 Chip is Very Powerful, Perfect For Developers Looking to Run XCode

I’m a software engineer, and in 2018 I wanted to try my hand at XCode development. I figured I’d buy the cheapest Mac Apple offered. This was the 2018 Mac Mini, which cost $800, and a multi-core GeekBench 5 score of 3203.

I was annoyed by that price/performance ratio, so I decided to build a Hackintosh. This Hackintosh had 16GB of RAM, a 512GB SSD, and an Intel Core i7 processor with a multi-core GeekBench 5 score of 5300. I built a machine that was twice as powerful as the top of the line 2018 Mac Mini, for $200 less than the base model. This machine is powerful; it has been fantastic for XCode development.

  • I am trying to set up my Macbook air with M1 Chip for mobile app development, the problem is when I am trying to download an android emulator through android studio it keeps on failing so I am beginning to think there is something I am not doing right, Even when I download the android emulator manually it won't open up.
  • In this video I'm setting up an Android development environment on the new Apple M1 MacBook Air with 16GB of RAM.Note: at time of recording, this is NOT the.

However, in 2020, Apple released a new M1 Mac Mini for only $700. My first thought was, “Can it compete with my Hackintosh.” And yes, not only can it compete, The M1 Mac Mini has a multi-core GeekBench 5 score of 7386. It blows my Hackintosh out of the water, and the base model is cost-competitive with my 2018 Hackintosh at only $700.

Just tried to run Android Studio (4.1.1) on Macbook Pro M1, it works, but: No emulators at this point. Can build and publish on Android Phone (Nexus 4a in my case) IntelliJ has some lags in performance on M1 (because it is not native, and Intel built), but feels pretty usable.

It’s quite impressive. The Hackintosh is officially dead (not just because you can’t buy Apple Silicon processors). I can no longer think of a great reason to build one over the M1 Mac Mini, or M1 Macbook Air. The best reason I can think of is Apple still gouges you if you want a 2TB hard drive. But, other than needing a beast of a machine the M1 Macs have the advantage. Bravo Apple.

Is 8GB of RAM Enough For XCode on the M1 Mac Mini, Macbook Air, and Macbook Pro?

This was the big question I had when I pulled the trigger and got the base M1 2020 Macbook Air. Was 8GB enough RAM to run the simulator without experiencing significant performance issues?

I know from my Hackintosh experience that a Mac can quickly get up over 8GB of RAM when running the XCode simulators. I rarely get my Mac up to 16GB of used RAM, but 8GB is pretty easy to surpass if you’re a developer with multiple tabs open. So I was very curious how much the 8GB model would slow down development.

If you’re curious too, I highly suggest you check out the YouTube video below from Max Tech. This guy went through and meticulously compared the performance of the 16GB model vs. the 8GB model while using tons of common apps.

The conclusion? Even if you edge up close to your 8GB of RAM limit, there’s not a massive drop in performance. He was experiencing things taking 10% longer on the 8GB model when he got around that limit. The integrated SSD’s of your Mac is fast to the point where a minor amount of swapping isn’t going to have a drastic effect on performance.

That said, this next guy is running Photoshop. He REALLY knows how to max out RAM on his machine. When you really give your Mac a task that takes significantly more than 8GB of RAM, you’ll notice a pretty substantial performance drop. It’s also worth a watch if you really want an in-depth example of this.

Apple

Personally, I’ll be forking over the extra $200 to get the 16GB model. But, I think unless you’re some type of power user, 8GB will be sufficient for you. The SSD Read speeds are so fast that you won’t notice a big performance drop unless you’re going WAY over the 8GB of RAM like in the Photoshop example above. There are probably very few use cases where that would ever happen.

There are people out there who are worried that swapping to your hard drive over and over could wear down your SSD. And if you intend to max out this machine 24/7 and still be running it in several years, I think that’s a valid concern.

For most developers and most people, I think you could easily get by with the 8GB model.

Do You Need To Run The XCode Simulator on the M1?

One of the cool things about the M1 Macs is that they can run iOS apps natively. This got me thinking, do I even need to debug my apps in the RAM hungry simulator anymore? Can I just run them straight from the Mac?… Yes!

Android

There is a “run on Mac” destination for iOS apps in XCode, which will run the app natively on the machine, not in a simulator. It’s cool; you’ll lose simulator functionality like rotation, sleep, home button, etc. But, it’s now possible to avoid using a RAM hungry simulator when developing your apps on M1 devices.

Rosetta 2 Performance Vs. Native Apps

Not all software has an ARM based version of their app yet (like Final Cut Plugins) and you have to run it through the Rosetta 2 simulator.

This usually works rather well. But, there’s definitely a noticeable drop off in performance when comparing non-native apps to native apps on this machine.

Emulator

This will become less of an issue over time as more companies compile their apps for the M1 chip. But, in the early days of a gen 1 product just keep in mind that there may be some issues.

Conclusion

The M1 Macs are powerful machines capable of XCode development at an OK price point. Well done Apple, I might have to consider becoming a Mac guy now.

This is the second post that I dedicate to talk about configurations using the new M1 Apple processor. As I said in the previous post, these configurations are workarounds until stable versions are released, however, for me, they have been useful and I guess that someone in the same situation as me can benefit from that.

Using Android studio in the new Macbook Air

When you install Android Studio you will get the following warning:

Unable to install Intel® HAXM

Your CPU does not support VT-x.

Unfortunately, your computer does not support hardware-accelerated virtualization.

Android

Here are some of your options:

1 - Use a physical device for testing

Macbook Air M1 Android Studio Emulator

2 - Develop on a Windows/OSX computer with an Intel processor that supports VT-x and NX

3 - Develop on a Linux computer that supports VT-x or SVM

4 - Use an Android Virtual Device based on an ARM system image

(This is 10x slower than hardware-accelerated virtualization)

Creating Android virtual device

Macbook Air M1 Android Emulator

Android virtual device Pixel_3a_API_30_x86 was successfully created

And also in the Android virtual device (AVD) screen you will read the following warning:

If you want to learn more regarding virtualization in processors you can read the following Wikipedia article, the thing is that our M1 processor doesn’t support VT-x, however, we have options to run an Android Virtual Device.

As the previous message was telling us, we have 4 options. The easiest way to proceed is to use a physical device, but what if you haven’t one available at the moment you are developing?

From now on, we will go with the option of using an Android virtual device based on an ARM system image as options 2 and 3 are not possible to execute.

Using the virtual emulator

The only thing that you have to do is to download the last available emulator for Apple silicon processors from Github https://github.com/741g/android-emulator-m1-preview/releases/tag/0.2

Once you have downloaded you have to right-click to the .dmg file and click open to skip the developer verification.

After installing the virtual emulator, we have to open it from the Applications menu.

After opening it you will see Virtual emulator in Android Studio available to deploy your Android application. Make sure to have Project tools available in Android Studio (View -> Tool Windows -> Project)

After pressing the launch button you will get your Android application running in your ARM virtual emulator :-)

Android Studio Mac M1

Conclusion

Macbook Air M1 India

In this post, we have seen that is possible to install Android Studio in Macbook Air M1 and use a virtual device even that your M1 doesn’t support VT-x. You can learn more about this emulator in the following references: