Android模拟器无法使用MAC

时间:2017-03-17 02:46:32

标签: android-studio android-emulator

下载Android Studio后,我一直在尝试使用Android模拟器。我以前使用旧的三星S4,但需要与Marshmallow兼容的某些功能。

我看到的问题是:

  • -Emulator不运行
  • -Android屏幕显示好像准备启动但不是
  • - 当安卓屏幕在等待一小时后消失时,屏幕显示对话框,表示系统没有响应,并等待或终止 过程
  • - 当我尝试在显示该屏幕时在AVD上运行app时,Android Studio出现错误,说AVD没有安装APK' s 正确并卸载或取消。

我尝试过的解决方案:

  • - 将AVD RAM降至512& 236 MB
  • - 关闭模拟器相机
  • - 关闭音频
  • -Graphics首选项设置为软件
  • - 删除和重新加载所有内容
  • - 确保API与SDK匹配
  • - 不同的API(25)
  • - 下载BlueStacks(没有意识到它使用了Kitkat)

慢速/不工作仿真器的大多数解决方案都与我更改和尝试的仿真器设置有关。我已经坚持了三天,我迫不及待地想要一个解决方案,所以我可以测试我的应用程序,它需要23 +的Android API。

请稍微注意,以防我失业。我使用的是运行在OSX Sierra,Core 2双核处理器,16GB RAM,1TB硬盘上的2010年中期MAC。

**更新 我通过命令行运行了模拟器,这是我收到的输出。电子邮件程序仍然在Android屏幕上加载,但在" Adb连接后,在过去30分钟内没有记录更多输出,开始代理数据"。

Macs-MacBook-Pro-2:sdk joncorrin$ tools/emulator @Nexus_5X_API_23 -verbose
emulator:Android emulator version 25.3.0.0 (build_id 3394391)
emulator:Found AVD name 'Nexus_5X_API_23'
emulator:Found AVD target architecture: x86
emulator:argv[0]: 'tools/emulator'; program directory: '/Users/mac/Library/Android/sdk/tools'
emulator:  Found directory: /Users/mac/Library/Android/sdk/system-images/android-23/google_apis/x86/

emulator:Probing for /Users/mac/Library/Android/sdk/system-images/android-23/google_apis/x86//kernel-ranchu: file exists
emulator:Auto-config: -engine qemu2 (based on configuration)
emulator:  Found directory: /Users/mac/Library/Android/sdk/system-images/android-23/google_apis/x86/

emulator:try dir /Users/mac/Library/Android/sdk/tools
emulator:try dir tools/
emulator:try dir emulator
emulator:Found target-specific 64-bit emulator binary: emulator/qemu/darwin-x86_64/qemu-system-i386
emulator:Adding library search path: 'emulator/lib64'
emulator:  Found directory: /Users/mac/Library/Android/sdk/system-images/android-23/google_apis/x86/

emulator:  Found directory: /Users/mac/Library/Android/sdk/system-images/android-23/google_apis/x86/

emulator:GPU emulation is disabled
emulator: Adding library search path for Qt: 'emulator/lib64/qt/lib'
emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=emulator/lib64/qt/plugins
emulator: Running :emulator/qemu/darwin-x86_64/qemu-system-i386
emulator: qemu backend: argv[00] = "emulator/qemu/darwin-x86_64/qemu-system-i386"
emulator: qemu backend: argv[01] = "@Nexus_5X_API_23"
emulator: qemu backend: argv[02] = "-verbose"
emulator: Concatenated backend parameters:
 emulator/qemu/darwin-x86_64/qemu-system-i386 @Nexus_5X_API_23 -verbose
emulator: WARNING: Crash service did not start

emulator: Android virtual device file at: /Users/mac/.android/avd/Nexus_5X_API_23.ini
emulator: virtual device content at /Users/mac/.android/avd/Nexus_5X_API_23.avd
emulator: virtual device config file: /Users/mac/.android/avd/Nexus_5X_API_23.avd/config.ini
emulator: using core hw config path: /Users/mac/.android/avd/Nexus_5X_API_23.avd/hardware-qemu.ini
emulator: Found AVD target API level: 23
emulator: Read property file at ./system-images/android-23/google_apis/x86//build.prop
emulator: No boot.prop property file found.
emulator: found skin 'nexus_5x' in directory: /Users/mac/Library/Android/sdk/skins/
emulator: autoconfig: -skin nexus_5x
emulator: autoconfig: -skindir /Users/mac/Library/Android/sdk/skins/
emulator: autoconfig: -kernel ./system-images/android-23/google_apis/x86//kernel-ranchu
emulator: Target arch = 'x86'
emulator: Auto-config: -qemu -cpu qemu32
emulator: Auto-detect: Kernel image requires new device naming scheme.
emulator: Auto-detect: Kernel does not support YAFFS2 partitions.
emulator: autoconfig: -ramdisk ./system-images/android-23/google_apis/x86//ramdisk.img
emulator: Using initial system image: ./system-images/android-23/google_apis/x86//system.img
emulator: autoconfig: -data /Users/mac/.android/avd/Nexus_5X_API_23.avd/userdata-qemu.img
emulator: autoconfig: -initdata /Users/mac/.android/avd/Nexus_5X_API_23.avd/userdata.img
emulator: autoconfig: -cache /Users/mac/.android/avd/Nexus_5X_API_23.avd/cache.img
emulator: autoconfig: -sdcard /Users/mac/.android/avd/Nexus_5X_API_23.avd/sdcard.img
emulator: Increasing RAM size to 1024MB
emulator: System image is read only
emulator: GPU emulation is disabled
emulator: Found 2 DNS servers: 75.75.75.75 75.75.76.76
emulator: trying to load skin file '/Users/mac/Library/Android/sdk/skins//nexus_5x/layout'
emulator: CPU Acceleration: working
emulator: CPU Acceleration status: HAXM version 6.0.5 (3) is installed and usable.
emulator: Adjusting Contiguous Memory Allocation of 1080x1920 framebuffer for software renderer to 16MB.
emulator: Found 2 DNS servers: 75.75.75.75 75.75.76.76
Content of hardware configuration file:
  hw.cpu.arch = x86
  hw.cpu.model = qemu32
  hw.cpu.ncore = 1
  hw.ramSize = 1024
  hw.screen = multi-touch
  hw.mainKeys = false
  hw.trackBall = false
  hw.keyboard = true
  hw.keyboard.lid = false
  hw.keyboard.charmap = qwerty2
  hw.dPad = false
  hw.gsmModem = true
  hw.gps = true
  hw.battery = true
  hw.accelerometer = true
  hw.audioInput = true
  hw.audioOutput = true
  hw.sdCard = true
  hw.sdCard.path = /Users/mac/.android/avd/Nexus_5X_API_23.avd/sdcard.img
  disk.cachePartition = true
  disk.cachePartition.path = /Users/mac/.android/avd/Nexus_5X_API_23.avd/cache.img
  disk.cachePartition.size = 66m
  hw.lcd.width = 1080
  hw.lcd.height = 1920
  hw.lcd.depth = 16
  hw.lcd.density = 420
  hw.lcd.backlight = true
  hw.gpu.enabled = false
  hw.gpu.mode = guest
  hw.gpu.blacklisted = no
  hw.initialOrientation = Portrait
  hw.camera.back = emulated
  hw.camera.front = emulated
  vm.heapSize = 256
  hw.sensors.light = true
  hw.sensors.pressure = true
  hw.sensors.humidity = true
  hw.sensors.proximity = true
  hw.sensors.magnetic_field = true
  hw.sensors.orientation = true
  hw.sensors.temperature = true
  hw.useext4 = true
  kernel.path = ./system-images/android-23/google_apis/x86//kernel-ranchu
  kernel.newDeviceNaming = yes
  kernel.supportsYaffs2 = no
  disk.ramdisk.path = ./system-images/android-23/google_apis/x86//ramdisk.img
  disk.systemPartition.initPath = ./system-images/android-23/google_apis/x86//system.img
  disk.systemPartition.size = 1280m
  disk.dataPartition.path = /Users/mac/.android/avd/Nexus_5X_API_23.avd/userdata-qemu.img
  disk.dataPartition.size = 2g
  disk.encryptionKeyPartition.path = /Users/mac/.android/avd/Nexus_5X_API_23.avd/encryptionkey.img
  avd.name = Nexus_5X_API_23
.
QEMU options list:
emulator: argv[00] = "emulator/qemu/darwin-x86_64/qemu-system-i386"
emulator: argv[01] = "-dns-server"
emulator: argv[02] = "75.75.75.75,75.75.76.76"
emulator: argv[03] = "-serial"
emulator: argv[04] = "null"
emulator: argv[05] = "-cpu"
emulator: argv[06] = "android32"
emulator: argv[07] = "-enable-hax"
emulator: argv[08] = "-m"
emulator: argv[09] = "1024"
emulator: argv[10] = "-lcd-density"
emulator: argv[11] = "420"
emulator: argv[12] = "-kernel"
emulator: argv[13] = "./system-images/android-23/google_apis/x86//kernel-ranchu"
emulator: argv[14] = "-initrd"
emulator: argv[15] = "./system-images/android-23/google_apis/x86//ramdisk.img"
emulator: argv[16] = "-object"
emulator: argv[17] = "iothread,id=disk-iothread"
emulator: argv[18] = "-drive"
emulator: argv[19] = "if=none,overlap-check=none,cache=unsafe,index=0,id=system,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/system.img.qcow2,read-only"
emulator: argv[20] = "-device"
emulator: argv[21] = "virtio-blk-pci,drive=system,iothread=disk-iothread,modern-pio-notify"
emulator: argv[22] = "-drive"
emulator: argv[23] = "if=none,overlap-check=none,cache=unsafe,index=1,id=cache,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/cache.img.qcow2,l2-cache-size=1048576"
emulator: argv[24] = "-device"
emulator: argv[25] = "virtio-blk-pci,drive=cache,iothread=disk-iothread,modern-pio-notify"
emulator: argv[26] = "-drive"
emulator: argv[27] = "if=none,overlap-check=none,cache=unsafe,index=2,id=userdata,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/userdata-qemu.img.qcow2,l2-cache-size=1048576"
emulator: argv[28] = "-device"
emulator: argv[29] = "virtio-blk-pci,drive=userdata,iothread=disk-iothread,modern-pio-notify"
emulator: argv[30] = "-drive"
emulator: argv[31] = "if=none,overlap-check=none,cache=unsafe,index=3,id=encrypt,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/encryptionkey.img.qcow2,l2-cache-size=1048576"
emulator: argv[32] = "-device"
emulator: argv[33] = "virtio-blk-pci,drive=encrypt,iothread=disk-iothread,modern-pio-notify"
emulator: argv[34] = "-drive"
emulator: argv[35] = "if=none,overlap-check=none,cache=unsafe,index=4,id=sdcard,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/sdcard.img.qcow2,l2-cache-size=1048576"
emulator: argv[36] = "-device"
emulator: argv[37] = "virtio-blk-pci,drive=sdcard,iothread=disk-iothread,modern-pio-notify"
emulator: argv[38] = "-netdev"
emulator: argv[39] = "user,id=mynet"
emulator: argv[40] = "-device"
emulator: argv[41] = "virtio-net-pci,netdev=mynet"
emulator: argv[42] = "-netdev"
emulator: argv[43] = "user,id=mynet2,net=10.0.3.0/24"
emulator: argv[44] = "-device"
emulator: argv[45] = "virtio-net-pci,netdev=mynet2"
emulator: argv[46] = "-show-cursor"
emulator: argv[47] = "-L"
emulator: argv[48] = "emulator/lib/pc-bios"
emulator: argv[49] = "-soundhw"
emulator: argv[50] = "hda"
emulator: argv[51] = "-vga"
emulator: argv[52] = "none"
emulator: argv[53] = "-append"
emulator: argv[54] = "qemu=1 androidboot.hardware=ranchu clocksource=pit android.qemud=1 console=0 console=0 android.checkjni=1 qemu.gles=2 qemu.encrypt=1 cma=32M ndns=2"
emulator: argv[55] = "-android-hw"
emulator: argv[56] = "/Users/mac/.android/avd/Nexus_5X_API_23.avd/hardware-qemu.ini"
Concatenated QEMU options:
 emulator/qemu/darwin-x86_64/qemu-system-i386 -dns-server 75.75.75.75,75.75.76.76 -serial null -cpu android32 -enable-hax -m 1024 -lcd-density 420 -kernel ./system-images/android-23/google_apis/x86//kernel-ranchu -initrd ./system-images/android-23/google_apis/x86//ramdisk.img -object iothread,id=disk-iothread -drive if=none,overlap-check=none,cache=unsafe,index=0,id=system,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/system.img.qcow2,read-only -device virtio-blk-pci,drive=system,iothread=disk-iothread,modern-pio-notify -drive if=none,overlap-check=none,cache=unsafe,index=1,id=cache,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/cache.img.qcow2,l2-cache-size=1048576 -device virtio-blk-pci,drive=cache,iothread=disk-iothread,modern-pio-notify -drive if=none,overlap-check=none,cache=unsafe,index=2,id=userdata,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/userdata-qemu.img.qcow2,l2-cache-size=1048576 -device virtio-blk-pci,drive=userdata,iothread=disk-iothread,modern-pio-notify -drive if=none,overlap-check=none,cache=unsafe,index=3,id=encrypt,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/encryptionkey.img.qcow2,l2-cache-size=1048576 -device virtio-blk-pci,drive=encrypt,iothread=disk-iothread,modern-pio-notify -drive if=none,overlap-check=none,cache=unsafe,index=4,id=sdcard,file=/Users/mac/.android/avd/Nexus_5X_API_23.avd/sdcard.img.qcow2,l2-cache-size=1048576 -device virtio-blk-pci,drive=sdcard,iothread=disk-iothread,modern-pio-notify -netdev user,id=mynet -device virtio-net-pci,netdev=mynet -netdev user,id=mynet2,net=10.0.3.0/24 -device virtio-net-pci,netdev=mynet2 -show-cursor -L emulator/lib/pc-bios -soundhw hda -vga none -append 'qemu=1 androidboot.hardware=ranchu clocksource=pit android.qemud=1 console=0 console=0 android.checkjni=1 qemu.gles=2 qemu.encrypt=1 cma=32M ndns=2' -android-hw /Users/mac/.android/avd/Nexus_5X_API_23.avd/hardware-qemu.ini
emulator: Starting QEMU main loop
Hax is enabled
Hax ram_size 0x40000000
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'both'
emulator: Adding boot property: 'ro.opengles.version' = '131072'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '256m'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.adb.secure' = '1'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '420'
HAX is working and emulator runs in fast virt mode.
emulator: goldfish_events.have-dpad: false
emulator: goldfish_events.have-trackball: false
emulator: goldfish_events.have-camera: true
emulator: goldfish_events.have-keyboard: true
emulator: goldfish_events.have-lidswitch: false
emulator: goldfish_events.have-touch: false
emulator: goldfish_events.have-multitouch: true
emulator: control console listening on port 5554, ADB on port 5555
Not using any http proxy
emulator: android_hw_fingerprint_init: fingerprint qemud listen service initialized

emulator: onGuestSendCommand: [0x7f80950cdc00] Adb connected, start proxing data

**更新

输出记录:

emulator: _hwFingerprint_connect: connect finger print listen is called

  emulator: got message from guest system fingerprint HAL

在最后30分钟。

Android显示延迟屏幕,表示"启动Android进程",然后30分钟后显示冻结屏幕,表明系统UI没有响应,后面有一个允许调试对话框。看图像。当我点击时,UI没有响应,并且日志没有输出超出我发布的内容。

enter image description here

11 个答案:

答案 0 :(得分:20)

你是否有机会安装Docker for Mac?我只是面对完全相同的问题,停止Docker解决问题......

答案 1 :(得分:11)

您也可以尝试从命令行启动模拟器。

  • cd $ ANDROID_SDK_ROOT
  • tools / emulator -list-avds
  • tools / emulator @name_of_avd -verbose

如果发现任何故障,您可以共享最后一个命令的输出。 ANDROID_SDK_ROOT环境值应指向android SDK位置。你可以在android studio下的菜单工具 - > sdk管理器中找到它。

答案 2 :(得分:3)

这里有什么最终对我有用:

在Android Studio(Mac OS X)中打开AVD Manager。单击有问题的Android虚拟设备上指向下方的三角形以获取下拉菜单。然后,以极大的报复和愤怒的愤怒打击 Delete

完成此操作后,请点击+ Create Virtual Device…。将大多数设置保留为默认设置,然后运行新的虚拟设备,就像它是一个美味的汉堡。

希望这对你也有用。 ^^

答案 3 :(得分:3)

这个对我有用

  1. 删除您目前拥有的所有AVD。
  2. 转到偏好设置>> Android SDK>> SDK工具
  3. 卸载Android模拟器
  4. 重启Android Studio。
  5. 从同一个地方重新安装Android模拟器。
  6. 创建一个新的模拟器! 希望这有助于。

答案 4 :(得分:1)

在我的旧Mac上(2010年中期2,8Ghz i5)我遇到了同样的问题,我想与社区分享我的解决方案以供将来使用:

  1. 从列表中卸载所有AVD。
  2. 下载最新版本的HAXM https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x
  3. 手动安装(它将根据请求自动卸载以前的版本)
  4. 为x86映像生成新的AVD。

答案 5 :(得分:1)

我在更新到 MacOS Big Sur 时遇到了这个问题,对我有用的是在 SDK 工具中更新 Android 模拟器。

答案 6 :(得分:0)

另一个选择,如果模拟器在mac上启动主窗口之前崩溃:提到ffmpeg,Docker运行将是一个罪魁祸首,而其他使用vcpu的东西,在我的情况下 - Virtualbox。确保杀死所有vbox ...进程。

答案 7 :(得分:0)

对我来说,在虚拟设备配置中将'Graphics'从'Automatic'更改为'Software - GLES 2.0',在我的macOS Sierra上工作了

答案 8 :(得分:0)

这对我有用;我正在使用OS EL-Capitan,我不想升级到High Sierra,升级后由于以下错误,我不能使用android studio模拟器:

  

仿真器:对不起,“ qemu-system-x86_64”无法在此版本上运行   macOS。 Qt需要macOS 10.12.0或更高版本

分为2个步骤:

  1. 在以下位置删除文件夹sdk: / Users / [用户名] / Library / Android / sdk

  2. 将文件夹sdk恢复为以前的格式。您可以从那里下载: http://www.software-id.net/sdk.zip

答案 9 :(得分:0)

我遇到了同样的问题,并且正在运行El Capitan。我尝试了上面列出的所有解决方案,但没有一个起作用,并且无法使仿真器正常工作。

因此,我随后查看了错误日志,并且正如预期的那样,原因是库不兼容。这是日志的快照:

Process:               qemu-system-x86_64 [891]
Path:                  /Users/USER/Library/Android/*/emulator
Identifier:            qemu-system-x86_64
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        studio [801]
Responsible:           qemu-system-x86_64 [891]
User ID:               501

Date/Time:             2020-03-24 16:45:31.709 -0400
OS Version:            Mac OS X 10.11.6 (15G22010)
Report Version:        11
Anonymous UUID:        C6045A70-81F1-1E8A-7E49-13842E8765D9


Time Awake Since Boot: 1000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000002, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/Users/patel/Library/Android/sdk/emulator/lib64/qt/lib:/Users/patel/Library/Android/sdk/emulator/lib64/gles_swiftshader:/Users/patel/Library/Android/sdk/emulator/lib64/gles_angle11:/Users/patel/Library/Android/sdk/emulator/lib64/gles_angle9:/Users/patel/Library/Android/sdk/emulator/lib64/gles_angle:/Users/patel/Library/Android/sdk/emulator/lib64

Dyld Error Message:
  Symbol not found: _kSecAttrKeyTypeECSECPrimeRandom
  Referenced from: /Users/USER/Library/Android/*/libQt5WebEngineCoreAndroidEmu.5.12.1.dylib (which was built for Mac OS X 10.12)
  Expected in: /System/Library/Frameworks/Security.framework/Versions/A/Security
 in /Users/USER/Library/Android/*/libQt5WebEngineCoreAndroidEmu.5.12.1.dylib

您可能会注意到这行

      Referenced from: /Users/USER/Library/Android/*/libQt5WebEngineCoreAndroidEmu.5.12.1.dylib (which was built for Mac OS X 10.12)

所以,我升级到了High Sierra,问题就消失了。

答案 10 :(得分:0)

在使用macOS Catalina(10.15.6)将DisplayLink Manager更新到1.1.0之后,将不会启动任何模拟器。仿真器并没有显示在窗口中,而只是菜单栏上的图标。我检查了所有以前的解决方案,但没有任何效果。

拔出扩展坞的电源后,仿真器可以正常启动,并且可以再次插入扩展坞。