26

I've upgraded to the M1 chip 2020 Macbook Air from a 7th gen. Intel chip pc. Overall, I'm very happy and content with it but when it comes to Android Studio performance, which I use quite often, it is very disappointing I'm sorry to say. When will an Apple Silicon compatible version be available? Are any of you guys have any clue?

melihozcann
  • 403
  • 1
  • 4
  • 9
  • 1
    Does this answer your question? [Apart from emulator, is android studio working fine in M1 macs](https://stackoverflow.com/questions/64906525/apart-from-emulator-is-android-studio-working-fine-in-m1-macs) – Zoe Mar 21 '21 at 13:12

7 Answers7

45

I had the exact problem and the solution was as follows: Open Android Studio, go to Help -> Edit Custom VM Options and add the following lines:

-Dsun.java2d.opengl=true
-Dsun.java2d.opengl.fbobject=false

Restart the IDE and wait for the files to sync. Done, IDE running smooth again.

Maickonn Castro
  • 546
  • 3
  • 4
  • 1
    Saved my day! It's very fast now. – Pedro Paulo Amorim Oct 13 '21 at 18:30
  • 4
    The only thing that works for me. Thanks! – UmutTekin Oct 19 '21 at 07:23
  • 5
    This does work on M1 Pro as well. Thanks! But can anyone explain what is the meaning of these 2 lines? – Dhaval Nov 11 '21 at 11:26
  • Finally! I was going crazy with this lag. Can't code at regular speed with everything lagging randomly. Finally this fixed it. Thank you! – Adrian Moisa Nov 27 '21 at 18:28
  • 5
    Can someone explain this please, it works like charm but what's going on? – Eibo Nov 30 '21 at 10:22
  • @Emad Aldeen, Maybe he's the one who was responsible for this issue and he's now providing us the solution. Just kidding! thanks man. you saved everything. you're awesome! – Al Walid Ashik Jan 24 '22 at 13:20
  • It saved my day, but what's happening under the hood – Lokesh Mar 23 '22 at 04:30
  • Hi, bro unfortunately android studio doesn't work at all after I add these two lines any idea! :( – mustafa hasria Jun 28 '22 at 09:16
  • 1
    For everyone who are curious about what those flags are, `opengl: To enable the OpenGL-based pipeline, which provides hardware acceleration. [1]` `opengl.fbobject: Setting this property will cause Java 2D to fall back on the older pbuffer-based codepath. [2]` [1] https://docs.oracle.com/javase/7/docs/technotes/guides/2d/flags.html [2] https://docs.oracle.com/javase/10/troubleshoot/java-2d-pipeline-rendering-and-properties.htm#JSTGD444 – vava044 Oct 12 '22 at 18:13
  • After a month of hardcore in my super laggy Android Studio (cant even load recommenndation when typing), you save me. It works like a charm, tysm – Khanh Tran Apr 14 '23 at 02:52
28

Starting from Android Studio Artic Fox version, they not only changed versioning number style (replaced number system with Year-styling Version names), but also introduced Android Studio for M1/Apple Silicon (arm arch 64bits).

To check if you'r using right Android Studio for your M1, click on 'About Android Studio' and check the runtime, it should show as aarch64 (ie. Arm architecture 64bits). If not, mostly you might be having x86_64 if you installed regular Mac's Android Studio. About Android Studio with [64 bits] arm runtime for M1

To switch to M1's Android Studio,

  1. first exit already installed Android Studio, if it's open.
  2. Go to Finder and under 'Applications', rename 'Android Studio' to preferably 'Android Studio_x86_64'.
  3. Go to Android Studio downloads page (https://developer.android.com/studio#downloads), and download the one tagged as 'Mac (64-bit, ARM)' and unzip and move to 'Applications'.
  4. Click to open 'Android Studio' from the Finder/Applications. You may drag and add it as a Dock shortcut option.

Good thing is that there is no extra installation required and the existing project, (at least for me), opened without any issues. Android-SDK based and Flutter projects should be good right after switch, NDK not yet there.

AS is now faster again as you are using it as intended on Apple M1's chipset. !

Robin
  • 554
  • 4
  • 9
  • 2
    Thank you so much. I was using x86_64. I have updated to 64 but arm and changed the VM options. It is working smoothly. – Happy Singh Oct 22 '21 at 03:04
11

Now Android Studio Bumblebee (2021.1.1) is available in Stable Channel. If your version is older than Bumblebee, download it for more performance.

I find out that the link shown by default is for intel architectures.

Automatic update performed by android studio also downloads the intel version even if this download occurs on a Mac with an ARM architecture (M1) .

You should navigate to the download options and choose ARM architecture manually.

You can download version 2021.1.1.22 Bumblebee for MAC ARM (M1) here (Link updated on Mar 7 2022 )

Yago Rey
  • 209
  • 2
  • 8
  • 4
    Artic Fox is a bit laggy as well in stable channel for my m1 MacBook air – vandit vasa Aug 03 '21 at 07:06
  • @vanditvasa I have found that the link shown by default is for intel architectures. You should navigate to the download options and manually choose the arm architecture – Yago Rey Aug 03 '21 at 08:23
  • @YagoReyViñas Bro how should I navigate Manually. Can you please Guide ? It will be very helpful if you edit your answer that how can we change it manually. Thanks – Irfan Yaqub Aug 10 '21 at 18:14
  • Hi @irfan. I add download link extracted from Android studio web. You can view download link in this page https://developer.android.com/studio?hl=es&gclid=Cj0KCQjw6s2IBhCnARIsAP8RfAhPg6cNKS5HoJy4sc5e2qFNBlY4QYAWacuqtO4ro3yQn7lahKfMEMsaAlANEALw_wcB&gclsrc=aw.ds#downloads – Yago Rey Aug 11 '21 at 09:33
  • 1
    yes, arm version is really faster in m1 macbook pro – Priyanka Aug 13 '21 at 07:04
  • after downloading the arm one it is running on another level. since i just updated to artic fox the arm version was not downloaded. thanks @YagoReyViñas. – pradyot1996 Aug 17 '21 at 12:43
  • 1
    This should be the accepted answer. – Tyler Wood Nov 18 '21 at 23:39
  • hmm..not sure I would trust using a link that is not pointing directly to android.com. The official link for downloads is here: https://developer.android.com/studio#downloads – Lingster Dec 07 '21 at 16:22
  • @Lingster The link that I show in the post is the one provided by Google to download Android Studio. You can check it on the download website that you mention. Corresponds to the download link of the Mac platform (64-bit, ARM), and I try to update the link as Google does so that the post is not outdated – Yago Rey Dec 07 '21 at 16:44
  • Working perfectly and *very* smooth in M1, 2020. – Aroldo Goulart Jan 31 '22 at 13:38
9

Check Android Studio Arctic Fox (2020.3.1) Beta 3 (have apple silicon support) https://developer.android.com/studio/archive

enter image description here

Arslan Tazhibaev
  • 262
  • 1
  • 4
  • 10
3

use Intellij CE the latest version released on April 6th has native support for m1 and its very fast and intuitive, i've been using it and it's not very different from android studio

Edit: September 21

Download m1 native supported Android studio through https://developer.android.com/studio/archive Download Mac (Apple silicon)

0

All the above did not work and my emulator was completely unusable but in my case the following fixed my issues:

  • Android studio Preferences > Tools > Emulator
  • Make sure 'Launch in a tool window' is checked
  • 'Wipe Data' on emulator and then relaunch

Having the emulator launch as a separate window caused a huge slowdown but this fixed it immediately

Kieran
  • 77
  • 1
  • 8
0

Using Flamingo Patch 2, sometimes the performance is attrocious.

Ie, it was taking seconds for a selection to be selected, seconds to respond to key presses, etc.

I had tried the opengl fixes above, but they weren't really resolving the issue.

I used the "Repair IDE" command in the File menu the other day for an unrelated reason, and Step 3 resolves the issue. At least temporarily.

The other issue appears to be that whenever the emulator fires up it slows to a crawl again... disabling launch in tool window solves that as it loads in an external app/process instead

stux
  • 2,526
  • 1
  • 13
  • 6