Failed to sync HAX vcpu context(MacOS Android虚拟机无法启动)

1. 现象:

Mac环境下,无法启动AndroidStudio中的Android虚拟机,AVD可启动,但相关Emulator启动最后会闪退,无法看到log。


2. 解决过程:

($ANDROID_HOME为Android Sdk路径)    

cd $ANDROID_HOME

查看AVD列表:

./android list avd


结果为:

*************************************************************************

The "android" command is deprecated.

For manual SDK, AVD, and project management, please use Android Studio.

For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager

*************************************************************************

Running /Users/afunx/Library/Android/sdk/tools/bin/avdmanager list avd


Available Android Virtual Devices:

    Name: Nexus_5_API_24

  Device: Nexus 5 (Google)

    Path: /Users/afunx/.android/avd/Nexus_5_API_24.avd

  Target: Google APIs (Google Inc.)

          Based on: Android 7.0 (Nougat) Tag/ABI: google_apis/x86

    Skin: nexus_5

  Sdcard: 100M


命令行启动AVD(Nexus_5_API_24请替换为实际AVD Name,依据./android list avd结果):

./emulator -avd Nexus_5_API_24

结果为:

Hax is enabled

Hax ram_size 0x60000000

HAX is working and emulator runs in fast virt mode.

Failed to sync vcpu reg

Failed to sync vcpu reg

Failed to sync vcpu reg

Failed to sync HAX vcpu contextInternal error: Initial hax sync failed


google搜索"Failed to sync HAX vcpu context"到stackover:

http://stackoverflow.com/questions/17024538/how-do-i-fix-failed-to-sync-vcpu-reg-error


3. 解决方法:

关掉所有虚拟机(包括genimotion、virtualbox、docker等),即可启动Android Studio自带的虚拟机。


4. 总结:

虽然,这里的解决方法是关掉所有虚拟机。但每个人情况可能不同。在Android Studio中,无法查看AVD启动失败的log。故可通过命令行的过程,来定位具体问题。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值