Emulator appearing offline on M1 Mac after the last update of arm64-v8a
Replace the avd system images you have downloaded with the r02 images. r03 is broken for me but reverting to r02 saved the day!
Update: It appears r03, r04, and r05 all don't work on m1
Google Play ARM 64 v8a System Image (revision: 2)
Google APIs ARM 64 v8a System Image (revision: 2)
With the latest android (4.1.3) on macOS, the directory you want to put the unzipped images in is probably something like ~/Library/Android/sdk/system-images/android-S
.
For example, the path for the google play image is ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/arm64-v8a
Android Studio/Emulator on macOS with ARM CPU M1
Good news !
Edit on 28th of July 2021 /p>
Apple Silicon Support
Now, there is an arm64 release version available for Android Studio Arctic Fox (2020.3.1)
You can download it from here https://developer.android.com/studio#downloads
Easy fix to use right architecture
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.
Use an 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 Google Play Store icon and click Next
- Choose an arm64-v8a on "Other Images" tab
When NDK runs into
Unknown host CPU architecture: arm64
you can solve it hereSolved https://stackoverflow.com/a/68285501/1079990kapt
doesn't work
Android Emulator not working or showing after update Big Sur 11.3
Based on this post this appears to be an issue with some hypervisor
entitlements that got updated in OSX 11.3.
Till an official fix is provided in the emulator app, it can be fixed by creating an entitlements.xml
file with the following content
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
</dict>
</plist>
and then running
codesign -s - --entitlements entitlements.xml --force ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
(the path to qemu might need to be adjusted depending on Android SDK's installation path)
This solution was also suggested on other similar posts, I repeated it here for convenience.
Android emulators are not working on macOS Big Sur 11.3+
Update, 10-1-2020
The Android Emulator team has pushed 30.1.5 which fixes this issue in stable. The dev build, 30.2.0 does not contain this fix. It should be available "soon" according to the Googler's working on this.
Another note, if you experience poor performance in your emulator you may wish to try using the host's GPU for rendering. This can be accomplished by running the following command in your terminal where -avd is the name of your emulator device with spaces turned to underscores.
~/Library/Android/sdk/emulator/emulator -gpu host -feature HVF -avd pixel_3a_api_29
Old information, kept for educational value:
This is the reference to the commit fixing this issue for Big Sur. This looks like it should be released in the emulator 30.1.5 (see log https://android.googlesource.com/platform/external/qemu/+log/refs/heads/emu-30-release) which should be in the next canary build.
If you can't wait, you should be able to build off that branch. Lightly tested guide heavily pulling from the readme of the repo:
# Get the google repo tool - you can skip if you already have it
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo && chmod +x /usr/local/bin/repo
# Get the code, will take some time. Probably best to go get a coffee here or run on a server if you have poor internet
mkdir -p $HOME/emu-master-dev && cd $HOME/emu-master-dev
repo init -u https://android.googlesource.com/platform/manifest -b emu-master-dev
repo sync -j8
# Get XCode 10.1 - required
https://download.developer.apple.com/Developer_Tools/Xcode_10.1/Xcode_10.1.xip
sudo xcodebuild -license accept &&
sudo xcode-select --install
# Get MacOS 10.13 SDK which is required
export XCODE_PATH=$(xcode-select -print-path 2>/dev/null)
git clone https://github.com/phracker/MacOSX-SDKs
cp -r MacOSX-SDKs/MacOSX10.13.sdk/ "$XCODE_PATH/Platforms/MacOSX.platform/Developer/SDKs"
# Build the emulator, which will be another coffee break...
cd external/qemu && android/rebuild.sh
# run it :)
./objs/emulator -list-avds
Android Emulator Render Issue - After macOS Big Sur Update
It seems that upgrading android studio (4.1.2), the emulator, and SDK tools fixes the issue since 2021.
After updating Android Studio, go to the preferences for Android Studio > Appearance & Behavior > System Settings > Android SDK > SDK Tools (tab) and select Android Emulator (I used 30.3.5), Android SDK Tools (26.1.1), and maybe the Android SDK Build-tools.
Disclaimer: These steps solved it for me. It might well be that only updating the "Android Emulator" SDK tool would have been enough.
Android Studio [BumbleBee 2021.1.1] Emulator Timeout on Mac M1
I have found the issue so marking this as solved, however, if anyone knows why this solves the problem, please share!
I found an issue opened on Google's anroid-emulator-m1-preview repo with this answer https://github.com/google/android-emulator-m1-preview/issues/76#issuecomment-1023563846
Turns out, I just needed to uncheck 'Launch in a tool window' but again, not sure why that fixed the issue.
Related Topics
Android: How to Change the Actionbar "Home" Icon to Be Something Other Than the App Icon
When Exactly Are Onsaveinstancestate() and Onrestoreinstancestate() Called
How to Change the Track Color of a Switchcompat
Fileprovider Crash - Npe Attempting to Invoke Xmlresourceparser on a Null String
How to Use Android Emulator for Testing Bluetooth Application
Logcat Not Displaying My Log Calls
Android Webview, Scaling Image to Fit the Screen
Http Status Code in Android Volley When Error.Networkresponse Is Null
Custom Format Edit Text Input Android to Accept Credit Card Number
React Native Adb Reverse Enoent
How to Disable Future Dates in Android Date Picker
Getting Started with Open Nfc Emulator
Android - Inner Element Must Either Be a Resource Reference or Empty
How to Make Proguard Ignore External Libraries
How to Change Font Size in Preferencescreen
Cache.Properties (The System Cannot Find the File Specified)
What Is the Benefit of Using Fragments in Android, Rather Than Views