我无法在Mac Mini上正确启动模拟器。 当我执行模拟器命令时,出现模拟器窗口,启动动画开始,但是过一会儿我收到以下错误消息:
ERROR: detected a hanging thread 'QEMU2 CPU0 thread'. No response for 15011 ms
仿真器要么退出要么完全没有响应。
Mac Mini将于2012年末推出,具有16GB RAM,2.5 GHz Intel Core i5 CPU和HD 4000显卡;并不是最快的,但是应该能够运行模拟器(并且过去能够做到这一点而没有问题)
我尝试过:
更新模拟器:
emulator -version
Android emulator version 28.0.25.0 (build_id 5395263) (CL:77b96786ddf712e1477c6e05cddb09526043faef)
验证是否已安装英特尔Haxm:
kextstat | grep intel
102 0 0xffffff7f83833000 0x28000 0x28000 com.intel.kext.intelhaxm (7.3.2) 58DFBE80-E54A-3EFE-B38A-215C5ED8E828 <7 5 4 3 1>
在没有音频和窗口的情况下运行模拟器:
emulator -no-audio -no-window -no-boot-anim @avd
(结果相同)
降低avd的分辨率:
hw.lcd.density = 240
hw.lcd.height = 960
hw.lcd.width = 540
在avd的config.ini中
禁用/启用IPv6不会更改任何内容。
完整的config.ini:
PlayStore.enabled = false
abi.type = x86
avd.ini.encoding = UTF-8
hw.accelerometer = yes
hw.audioInput = yes
hw.battery = yes
hw.cpu.arch = x86
hw.dPad = no
hw.device.hash2 = MD5:1c925b9117dd9f33c5128dac289a0d68
hw.device.manufacturer = Google
hw.device.name = Nexus 5
hw.gps = yes
hw.lcd.density = 240
hw.lcd.height = 960
hw.lcd.width = 540
hw.mainKeys = no
hw.sdCard = no
hw.sensors.orientation = yes
hw.sensors.proximity = yes
hw.trackBall = no
image.sysdir.1 = system-images/android-28/google_apis/x86/
tag.display = Google APIs
tag.id = google_apis
hw.gpu.mode = host
hw.gpu.enabled = yes
skin.dynamic = yes
hw.ramSize = 2048
仿真器命令的完整输出:
emulator @avd
2019-04-05 14:42:46.888 qemu-system-x86_64[72065:9498885] GetInputSourceEnabledPrefs user file path = /Users/dgns/Library/Preferences/com.apple.HIToolbox.plist
2019-04-05 14:42:46.888 qemu-system-x86_64[72065:9498885] GetInputSourceEnabledPrefs effective user id path = 501
2019-04-05 14:42:46.888 qemu-system-x86_64[72065:9498885] GetInputSourceEnabledPrefs user pref content = <CFBasicHash 0x7fa6a164d730 [0x7fffaa5028e0]>{type = immutable dict, count = 1,
entries =>
0 : <CFString 0x7fa6a1616070 [0x7fffaa5028e0]>{contents = "AppleSavedCurrentInputSource"} = <CFBasicHash 0x7fa6a164d6f0 [0x7fffaa5028e0]>{type = immutable dict, count = 3,
entries =>
0 : <CFString 0x7fffaa570f68 [0x7fffaa5028e0]>{contents = "InputSourceKind"} = <CFString 0x7fffaa5b64a8 [0x7fffaa5028e0]>{contents = "Keyboard Layout"}
1 : <CFString 0x7fffaa56bc68 [0x7fffaa5028e0]>{contents = "KeyboardLayout Name"} = Austrian
2 : <CFString 0x7fffaa5a25e8 [0x7fffaa5028e0]>{contents = "KeyboardLayout ID"} = <CFNumber 0x5c37 [0x7fffaa5028e0]>{value = +92, type = kCFNumberSInt64Type}
}
}
emulator: INFO: boot completed
emulator: ERROR: detected a hanging thread 'QEMU2 CPU0 thread'. No response for 15011 ms
emulator: ERROR: detected a hanging thread 'QEMU2 CPU1 thread'. No response for 15011 ms
emulator: ERROR: detected a hanging thread 'QEMU2 CPU0 thread'. No response for 15011 ms
which emulator
/Users/<user>/Library/Android/sdk/emulator/emulator
预期结果:仿真器启动,并且此后能够运行自动化测试
实际结果:模拟器退出或挂起
答案 0 :(得分:1)
我在Mac Mini上遇到了同样的问题。这对我有用:
转到“工具”->“ AVD管理器”->“编辑(特定的模拟器)”>“显示高级设置”
然后在“模拟性能”部分中,将其从“快速启动”更改为“冷启动”。
如果其他方法无效,可以找到here。
答案 1 :(得分:0)
我去了工具-> AVD管理器->编辑(特定的模拟器)>显示高级设置
然后在“仿真性能”部分中,选择了“快速启动”,将其更改为“冷启动”,一切开始正常运行。