Android emulator apple silicon preview

Android emulator apple silicon preview

Android Emulator M1 Preview

Note: There is an official repo now which is preferred: (https://github.com/google/android-emulator-m1-preview). We will still watch this repo for issues and comments, but please redirect your activity to the official repo.

This is a preview of some basic Android emulation functionality on the M1. There are still many issues, but apps work at a basic level. To be updated soon with more fixes. The release tag corresponds to this commit: https://android.googlesource.com/platform/external/qemu/+/aca144a9e9264b11c2d729096af90d695d01455d

  • Webview doesn’t work
  • No device skins
  • Video codecs not working
  • 32 bit ARM apps won’t work
  • Graphical glitches in some Vulkan apps
  • Popup on startup about not being able to find the ADB path (ADB will still notice the emulator if you have it installed though)
  • When building, it may be faster to start then cancel the Python triggered build and then reissue ninja -C objs install/strip versus letting the Python triggered build finish.

This only works on M1 Apple Silicon Macs. M1 (or equivalently capable) SoCs are required; note that this does not work on DTKs as they do not support ARM64 on ARM64 hardwre virtualization via Hypevisor.framework.

Go to the Github releases page, download a .dmg, drag to the Applications folder, and run. You’ll first need to right click the app icon and select Open and then skip past the developer identity verification step (we are working on providing official identity info). The first few times it starts up it will take a while to show up, but subsequent launches will be faster.

If you’ve installed Android Studio and Android SDK and adb is available, the emulator should be visible from Studio and work (deploy built apps, debug apps, etc).

How to configure

Edit /Applications/Android\ Emulator.app/Contents/MacOS/aosp-master-arm64-v8a/config.ini . Some notable options:

  • disk.dataPartition.size : size of userdata. When reconfiguring, you’ll also need to delete all userdata*.img files in that directory.
  • fastboot.forceColdBoot , fastboot.forceFastBoot : whether to enable snapshots. Current default is snapshots disabled. Set fastboot.forceColdBoot=no , fastboot.forceFastBoot=yes to enable snapshots.
  • hw.lcd.density : Virtual display DPI.
  • hw.lcd.width , hw.lcd.height : Virtual display dimensions.
  • hw.ramSize : RAM limit for the guest. (2GB minimum)

How to wipe data

Remove all userdata*.img files in /Applications/Android\ Emulator.app/Contents/MacOS/aosp-master-arm64-v8a/ .

How to build your own emulator

Building the engine

The emulator source code lives (here), but there are a bunch of other dependencies to download, so we use repo .

To build, first make sure you have Xcode and Xcode command line tools installed, and that you have Chromium depot_tools in your PATH (link). Then:

Note that canceling the python based build after it gets going and issuing just ninja -C objs install/strip may be faster.

The built artifacts are in /path/to/external/qemu/objs/distribution/emulator . They should be automatically signed. However, the binaries in objs/ are not; to sign them, issue ./sign-objs-binaries.sh . Note that this can only be done after ninja -C objs install/strip is successful.

Building the system image

The system image is built from AOSP master sdk_phone_arm64 with a few modifications. Ideally, let’s be on a Linux host when building the system image—the build is relatively untested on M1 systems, and at least, we need to create a separate case sensitive partition for the AOSP repo. Assuming you’re on Linux:

Читайте также:  Гарнитура с шумоподавлением для iphone

We first need to make an edit to remove all 32 bit support. Patch this change: link to build/make/target/board/emulator_arm64/BoardConfig.mk . Then:

After that’s done, we can use this script to package up the system image for use in /Applications/Android\ Emulator.app/Contents/MacOS/aosp-master-arm64-v8a/ . Assuming you’re still in the Android build environment:

Then, $ZIPPED_NAME.zip can be sent over to the M1 and the contents of its files/ can be coped over into /Applications/Android\ Emulator.app/Contents/MacOS/aosp-master-arm64-v8a/ .

About

A place to store preview versions of Android Emulator on Apple Silicon and provide instructions/support.

Источник

Android emulator apple silicon preview

Note: No longer needed

Support for downloading the M1-based emulator was added to SDK Manager, so it’s not necessary to go to the Github releases page to download a standalone .app anymore. In AVD Manager go to the Other Images tab as by default it doesn’t show the ARM64 images.

Android Emulator M1 Preview

This is a preview of some basic Android emulation functionality on the M1. There are still many issues, but apps work at a basic level. To be updated soon with more fixes. The release tag corresponds to this commit: https://android.googlesource.com/platform/external/qemu/+/aca144a9e9264b11c2d729096af90d695d01455d

  • Webview doesn’t work in the AOSP version, but works in the Google APIs version preview v3. However, Chrome doesn’t work.
  • No device skins
  • Video codecs not working
  • 32 bit ARM apps won’t work
  • Graphical glitches in some Vulkan apps
  • Popup on startup about not being able to find the ADB path (ADB will still notice the emulator if you have it installed though)
  • When building, it may be faster to start then cancel the Python triggered build and then reissue ninja -C objs install/strip versus letting the Python triggered build finish.

This only works on M1 Apple Silicon Macs. M1 (or equivalently capable) SoCs are required; note that this does not work on DTKs as they do not support ARM64 on ARM64 hardware virtualization via Hypevisor.framework.

Go to the Github releases page, download a .dmg, drag to the Applications folder, and run. You’ll first need to right click the app icon and select Open and then skip past the developer identity verification step (we are working on providing official identity info). The first few times it starts up it will take a while to show up, but subsequent launches will be faster.

If you’ve installed Android Studio and Android SDK and adb is available, the emulator should be visible from Studio and work (deploy built apps, debug apps, etc).

How to configure

Edit /Applications/Android\ Emulator.app/Contents/MacOS/aosp-master-arm64-v8a/config.ini . Some notable options:

  • disk.dataPartition.size : size of userdata. When reconfiguring, you’ll also need to delete all userdata*.img files in that directory.
  • fastboot.forceColdBoot , fastboot.forceFastBoot : whether to enable snapshots. Current default is snapshots disabled. Set fastboot.forceColdBoot=no , fastboot.forceFastBoot=yes to enable snapshots.
  • hw.lcd.density : Virtual display DPI.
  • hw.lcd.width , hw.lcd.height : Virtual display dimensions.
  • hw.ramSize : RAM limit for the guest. (2GB minimum)

How to wipe data

Remove all userdata*.img files in /Applications/Android\ Emulator.app/Contents/MacOS/aosp-master-arm64-v8a/ .

How to build your own emulator

Building the engine

The emulator source code lives (here), but there are a bunch of other dependencies to download, so we use repo .

Читайте также:  Как найти мой айфон через андроид

To build, first make sure you have Xcode and Xcode command line tools installed, and that you have Chromium depot_tools in your PATH (link). Then:

Note that canceling the python based build after it gets going and issuing just ninja -C objs install/strip may be faster.

The built artifacts are in /path/to/external/qemu/objs/distribution/emulator . They should be automatically signed. However, the binaries in objs/ are not; to sign them, issue ./sign-objs-binaries.sh . Note that this can only be done after ninja -C objs install/strip is successful.

Building the system image

The system image is built from AOSP master sdk_phone_arm64 with a few modifications. Ideally, let’s be on a Linux host when building the system image—the build is relatively untested on M1 systems, and at least, we need to create a separate case sensitive partition for the AOSP repo. Assuming you’re on Linux:

Источник

Android Studio/Emulator on macOS with ARM CPU M1

I started Android Studio 4.1 in macOS Big Sure 11.0.1 with new ARM cpu M1

After installing Rosetta: Yes, it builds !

But the Emulator has problems, it shows me CPU does not support VT-x

Even ARM images have this issue

I used the most recent, a very old api25 (Google has to do here something) but it’s increadible slow

How to make the Emulator work and fast ?

10 Answers 10

Edit on 28th July 2021 🎉 🌈

There is an arm64 release version available for Android Studio Arctic Fox (2020.3.1) You can download it here https://developer.android.com/studio/archive

Use a arm64-v8a image !

  • Tools -> SDK Manager
  • Install Android 11 (R) or 12.0 (S) and click Apply
  • Tools -> AVD Manager -> click Create Virtual Device
  • Choose any device that has the Play button and click Next
  • Choose an arm64-v8a on «Other Images» tab

When NDK runs into Unknown host CPU architecture: arm64 you can solve it here

End of beta ! Thank you

Edit on May 2021 🎉 🌈

There is an arm64 version available for Android Studio Arctic Fox (2020.3.1) Canary 15 . RC01 You can download it here https://developer.android.com/studio/archive

Edit on 4th Feb 2021

  • Go to AVD Manager
  • Click «+ Create Virtual Device»
  • Choose a Device definition (ex. «Pixel 4a XL»)
  • Click «Next»
  • Click «Other images»
  • Download «S» System image
  • Click «Next»
  • Click «Finish»

Steps to run your Android APP on M1

Finally my Android APP running normally on my M1 chip !

This presume you already have your environment variables set.

Download Android Studio Arctic Fox (2020.3.1) Link (I personally got the last I could September 1, 2021)

Install and open Android Studio

Tools -> SDK Manager

Check the box of Android 12.0 (S) and click Apply

. Wait until it’s downloaded

Tools -> AVD Manager -> click Create Virtual Device

Choose any device that has the Play button and click Next

Choose the image S. If you can’t find it in the Recommended tab click on Other Images

Final step click Next and Finish

You should now be ready to go.

You can now download the Android Studio Canary. In which you can run the android emulator with out any limitation of the android emulator m1 preview. In android emulator m1 preview there are issues with webview , device skin, sound etc..now you dont have to worry about that

Читайте также:  Что делать если айфон не поддерживает оператора

Here is the link

This fixed my issue

Tools -> SDK Manager -> SDK Tools (tab) -> Deselect ‘Android Emulator’ -> OK

Now, when you try to run your app, or launch device from AVD Manager, it will give the ‘Install Emulator’ error -> Click Ok. This will automatically download the correct version.

Now It’s available

Apple Silicon Support

Android Studio Arctic Fox Canary 15 contains preliminary support for Apple Silicon (arm64). This version of Android Studio for this platform is still under active development, but we wanted to get a functional version out to the app developer community to get feedback. On top of the Intellij build, design tools work, and the Android Emulator works with API 30 and API S Developer Preview emulator system images.

For me I can run the emulator on my MacBook Pro MacOS Big Sur with ARM CPU M1 only on Android Studio Arctic Fox (2020.3.1 Beta03 and later versions) only after deleting Intel x86 Emulator Accelerator (HAXM installer).

It is not clear exactly what problems Google has had that they still have no way to release the M1 version. I got the DTK M1 almost a year ago. I think Google got it even earlier. Yes, there was a problem with emulation, but everything else in the IDE could definitely be done.

At least a loner did it without too much trouble. There is roughness, but the speed of work is different from sky and earth. Working with a regular Android Studio on M1 is almost impossible, and even with this refinement amateur, everything flies like lighting.

This is an unofficial canary version of Android Studio Arctic Fox with emulators on the Apple Silicon. I’m using it and it works well in most cases.

Источник

Android Emulator stuck loading screen on M1 mac/ Apple Silicon

I had downloaded Android Studio on my M1 MacBook air but I can’t run the emulator and it just gives me an error. I search Android Studio requirements for mac and it says that it requires mac os 10.10 or higher and a minimum of 2 GB disk space and 4GB of ram. Anyone have this issue and how do I solve it?

I try download the arm image android studio it is stuck on the loading screen for the emulator.

15 Answers 15

As for now (19/11/2020) any of the Virtualization tools do not work with the new Apple M1 macs. So things like docker, emulators etc. We might have to wait a bit until this is fully supported unfortunately.

Edit on 28th July 2021 🎉 🌈

There is an arm64 release version available for Android Studio Arctic Fox (2020.3.1) You can download it here https://developer.android.com/studio/archive

When NDK runs into Unknown host CPU architecture: arm64 you can solve it here

End of beta ! Thank you

Edit on March 2021

In the blog there is a link to a private repo (2021-Jan-04). They moved repo to google and there you find V3 https://github.com/google/android-emulator-m1-preview/releases

Since v3 even audio-out works (no audio-in)

Edit on 4th Feb 2021

Edit March 2021

You can simply use one of them and it’s working out of the box

Источник

Оцените статью
Добавить комментарий