Android emulators are not working on OSX Big Sur

后端 未结 6 1722
抹茶落季
抹茶落季 2021-02-20 04:03

I have upgraded the mac OS to Big Sur and none of the emulators are working. It seems that all Android emulators Fails on Mac OS Big Sur Beta. I deleted the old emulators and cr

相关标签:
6条回答
  • 2021-02-20 04:31

    After last BigSur beta update (11.0 Beta (20A5395g)), Android Studio keeps shuting down. UI is not responding if I open any subwindow...

    Never more beta

    0 讨论(0)
  • 2021-02-20 04:36

    After trying many of the answers / comments on SO, found this workaround to work and be reproducible:

    1. Setup a new AVD

    I used Pixel 3 & 3a, API 30, default options

    1. Launch the AVD using the emulator CLI
    $ ~/Library/Android/sdk/emulator/emulator @Pixel_3a_API_30
    

    You'll see the infamous ...unhandled exit 1d

    1. Cancel the command with ⌃ + c or press the x on the emulator sidebar

    You should see a spinner about Saving State...

    1. Run the emulator again (step 2), this time it should show:

    5. Click DISMISS (or wait) and the emulator should boot into Android

    Note: Starting the same AVD from Android Studio / AVD Manager GUI will still run into this exception, so when you need it - start the emulator like in step 2.

    0 讨论(0)
  • 2021-02-20 04:37

    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
    
    0 讨论(0)
  • 2021-02-20 04:43

    My solution is wiping data from Android studio AVD, then start it again and again until it is successfully launched, using ./emulator @Pixel_3a_API_29 command.

    0 讨论(0)
  • 2021-02-20 04:51

    Seems to work with emulator 30.2.6 (latest in beta channel at this moment) Although there was a problem with a lockfile that prevented the emu from launching.

    Here's what brought everything back to normal:

    1. Wiping data of all AVDs (not sure if this is required)
    2. Looking through every ~/.android/avd/*.avd/ folder and removing the hardware-qemu.ini.lock file if present.
    0 讨论(0)
  • 2021-02-20 04:52

    Running the emulator like this:

    ~/Library/Android/sdk/emulator/emulator -wipe-data @Pixel_3a_API_30
    

    Fixed it for me.

    0 讨论(0)
提交回复
热议问题