无法使用ERROR启动Android模拟器:还有另一个使用当前AVD运行的模拟器实例

时间:2017-08-15 12:47:25

标签: android linux android-emulator

使用CLI并使用以下命令运行模拟器:

./emulator -use-system-libs @Nexus5API25

仅显示错误,模拟器无法启动。

emulator: ERROR: There's another emulator instance running with the current AVD 'Nexus5API25'. Exiting...

  • 没有正在运行的仿真器实例。
  • Nexus5API25确实存在并且过去正在使用。
  • 我必须在我的机器上使用-use-system-libs标志来启动模拟器实例。
  • 其他AVD正在运作。

当使用-verbose执行时,会打印更多详细信息,但我没有看到任何可以帮助我解决问题的内容:

emulator:Android emulator version 26.1.3.0 (build_id 4205252) (CL:e55642d861e04276b2fa453bfaff4a836f3a3269)
emulator:Found AVD name 'Nexus5API25'
emulator:Found AVD target architecture: x86_64
emulator:argv[0]: './emulator'; program directory: '/home/developer/opt/Android/Sdk/emulator'
emulator:  Found directory: /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64/

emulator:Probing for /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu: file exists
emulator:Auto-config: -engine qemu2 (based on configuration)
emulator:  Found directory: /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64/

emulator:try dir /home/developer/opt/Android/Sdk/emulator
emulator:Found target-specific 64-bit emulator binary: /home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64
emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64'
emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_swiftshader'
emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_angle'
emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_angle9'
emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_angle11'
emulator: Adding library search path for Qt: '/home/developer/opt/Android/Sdk/emulator/lib64/qt/lib'
emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=/home/developer/opt/Android/Sdk/emulator/lib64/qt/plugins
emulator: Running :/home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64
emulator: qemu backend: argv[00] = "/home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64"
emulator: qemu backend: argv[01] = "-verbose"
emulator: qemu backend: argv[02] = "-use-system-libs"
emulator: qemu backend: argv[03] = "@Nexus5API25"
emulator: Concatenated backend parameters:
 /home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64 -verbose -use-system-libs @Nexus5API25
emulator: Android virtual device file at: /home/developer/.android/avd/Nexus5API25.ini
emulator: virtual device content at /home/developer/.android/avd/Nexus_5_API_25.avd
emulator: virtual device config file: /home/developer/.android/avd/Nexus_5_API_25.avd/config.ini
emulator: using core hw config path: /home/developer/.android/avd/Nexus_5_API_25.avd/hardware-qemu.ini
emulator: Found AVD target API level: 25
emulator: Read property file at /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//build.prop
emulator: No boot.prop property file found.
emulator: found skin 'nexus_5' in directory: /home/developer/opt/Android/Sdk/skins/
emulator: autoconfig: -skin nexus_5
emulator: autoconfig: -skindir /home/developer/opt/Android/Sdk/skins/
emulator: autoconfig: -kernel /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu
emulator: Target arch = 'x86_64'
emulator: Auto-detect: Kernel image requires new device naming scheme.
emulator: Auto-detect: Kernel does not support YAFFS2 partitions.
emulator: autoconfig: -ramdisk /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//ramdisk.img
emulator: Using initial system image: /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//system.img
emulator: No vendor image
emulator: autoconfig: -data /home/developer/.android/avd/Nexus_5_API_25.avd/userdata-qemu.img
emulator: autoconfig: -initdata /home/developer/.android/avd/Nexus_5_API_25.avd/userdata.img
emulator: autoconfig: -cache /home/developer/.android/avd/Nexus_5_API_25.avd/cache.img
emulator: autoconfig: -sdcard /home/developer/.android/avd/Nexus_5_API_25.avd/sdcard.img
emulator: Physical RAM size: 1536MB

emulator: VM heap size 128MB is below hardware specified minimum of 384MB,setting it to that value
emulator: System image is read only
emulator: Found 1 DNS servers: 127.0.0.53
emulator: ERROR: There's another emulator instance running with the current AVD 'Nexus5API25'. Exiting...

我知道我可以删除AVD并创建新的AVD。但有没有办法解决现有AVD的问题,而无需重新创建它?

4 个答案:

答案 0 :(得分:62)

我设法通过删除由avd manager创建的锁定文件来解决问题。

rm ~/.android/avd/Nexus_5_API_25.avd/hardware-qemu.ini.lock

删除文件后,模拟器一直运行正常。

答案 1 :(得分:2)

在Linux中,它也可能是由root创建的AVD引起的,而另一个用户试图运行模拟器。在这种情况下,更改avd文件夹内容的所有者应该有助于解决它。

null

答案 2 :(得分:1)

即使没有其他模拟器正在运行,我也遇到了同样的问题。

在我的例子中,保存avd目录的文件系统是只读的。重新安装它rw解决了问题

mount -o remount,rw /path/to/avd/file/system

答案 3 :(得分:0)

您是否曾尝试在运行脚本之前终止该进程?

首先找到PID

adb shell ps 

然后你杀了进程

adb shell kill <PID>