Android 模拟器无法在 MAC 上运行 [英] Android Emulator not working on MAC

查看:38
本文介绍了Android 模拟器无法在 MAC 上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've been trying to use the Android Emulator after downloading Android Studio. I've used an old Samsung S4 before, but need something compatible to Marshmallow for certain features.

我看到的问题是:

  • -模拟器不运行
  • -Android 屏幕显示好像正在准备启动但没有
  • -当Android屏幕在等待一小时后消失时,屏幕显示对话框,提示系统无响应,等待或杀死过程
  • -当我尝试在显示该屏幕时在 AVD 上运行应用程序时,会弹出来自 Android Studio 的错误消息,指出 AVD 未安装 APK正确地卸载或取消.

我尝试过的解决方案:

  • -将 AVD RAM 降低到 512 &236 MB
  • -关闭模拟器摄像头
  • -关闭音频
  • -图形首选项设置为软件
  • -删除并重新下载所有内容
  • -检查以确保 API 与 SDK 匹配
  • -尝试不同的 API (25)
  • -下载 BlueStacks(没有意识到它使用 Kitkat)

大多数针对缓慢/不工作的模拟器的解决方案都与我更改并尝试过的模拟器设置有关.我已经坚持了三天,迫切需要一个解决方案,这样我就可以测试我的应用程序,它需要 23 + 的 Android API.

Most of the solutions for a slow/not working emulators were related to the Emulator settings of which I changed and tried. I've been stuck on this for three days and am desperate for a solution so I can test my app which requires Android API of 23 +.

一个小小的旁注,以防万一我不走运.我使用的是运行在 OSX Sierra、Core 2 duo 处理器、16GB RAM、1TB 硬盘上的 2010 年中期 MAC.

A little side note just in case I'm out-of-luck. I'm using a mid-2010 MAC running on OSX Sierra, Core 2 duo processor, 16GB RAM, 1TB hard drive.

**更新我已经通过命令行运行了模拟器,这是我收到的输出.模拟器仍在 Android 屏幕上加载,但在Adb 连接,开始代理数据"后的最后 30 分钟内没有记录更多输出.

**Update I've ran the emulator through the command line and here is the output that I am receiving. The emaulator is still loading on the Android Screen but no more output has been logged for the last 30 minutes after "Adb connected, start proxing data".

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 分钟内.

in the last 30 minutes.

Android 显示滞后屏幕,显示正在启动 Android 进程",然后 30 分钟后显示冻结屏幕,说明系统 UI 没有响应,后面有一个允许调试对话框.看图片.当我点击时,用户界面没有响应,日志没有输出超出我发布的任何内容.

Android shows laggy screen that said "Starting Android Process", then 30 minutes later showed frozen screen that stated the system UI is not responding, with a allow debugging dialog behind it. See images. When I click, the UI is not responding and the logs are not outputting anything beyond what I posted.

推荐答案

这个对我有用

  1. 删除您当前拥有的所有 AVD.
  2. 转到首选项 >> Android SDK >> SDK 工具
  3. 卸载安卓模拟器
  4. 重启 Android Studio.
  5. 从同一位置重新安装 Android 模拟器.
  6. 创建一个新的模拟器!希望这会有所帮助.

这篇关于Android 模拟器无法在 MAC 上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆