Android Device Manager fails to launch after updating to MacOS Big Sur 11.3
Update 2021-04-29: Emulator version 30.5.6 now in stable channel and it fixes this issue. Old answer preserved below.
Apple has changed hypervisor entitlements (permissions), deprecating com.apple.vm.hypervisor
with com.apple.security.hypervisor
. Before Google fixes emulator code signing with the new entitlements you can work around the issue by granting the entitlement yourself.
Create a file entitlements.xml
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 run
codesign -s - --entitlements entitlements.xml --force /usr/local/bin/qemu-system-x86_64
Replace qemu path as necessary where your SDK is located. Could be e.g. ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
on some SDK installations.
Answer based on https://www.arthurkoziel.com/qemu-on-macos-big-sur/
Related issues:
- https://issuetracker.google.com/issues/181142249
- https://issuetracker.google.com/issues/186436367
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 Emulator can not start after update to macOS Big Sur 11.3 today
This error occurs because Apple has made changes to the hypervisor entitlements. What you want to do is:
Use
/Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
as the directory forqemu
Add the entitlement to the
qemu-system-x86_64
binary by:- First create an xml file named
entitlements.xml
(does not matter where) with this 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>- Then sign the
qemu
binary with it:
codesign -s - --entitlements entitlements.xml --force /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
- First create an xml file named
For more context, refer here
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 Studio Hardware & Software Device Emulation not working on MacOS
Ok confirming that this was a Big Sur Beta issue, I reverted down to a stable release and can run as expected :|
Can't launch AVD on macOS 10.13
Use the new Hypervisor.Framework support instead of HAXM on macOS, as described in the comments of the issue filed for this:
Try running the emulator on Canary channel 26.1.x (API 25/26
recommended) with Hypervisor.Framework; put the text "HVF = on" in
~/.android/advancedFeatures.ini (create this file if it doesn't exist
already).
Related Topics
Multiple Screen Support in Android
Can't Get Values Out of Ondatachange Method
How to Loop Through Dynamic JSON String Recursively in Android
Which Architecture Patterns Are Used on Android
Android: How to Make Keyboard Enter Button Say "Search" and Handle Its Click
Overlap Scrolling View with Appbarlayout
Volley Android Networking Library
How to Perform Collection Group Query Using Document Id in Cloud Firestore
Centering Recyclerview Items with Flexboxlayoutmanager
Answer Incoming Call Using Android.Telecom and Incallservice
Supporting Multiple Screen Size - Android
Android Device Manager Fails to Launch After Updating to MACos Big Sur 11.3
How to Apply Zoom, Drag and Rotation to an Image in Android
Why Does My App Size on Device Differ Than the APK or Play Store Size
How to Send Data Back from Onpostexecute in an Asynctask
Org.JSON.JSONobject Cannot Be Converted to JSONarray in Android