问题描述
离线环境下部署Android虚拟机,启动时报错The emulator process for AVD xxx has terminated,其中xxx为虚拟机名称。
解决过程
可先在C:\Users\admin\AppData\Local\Google\AndroidStudio2024.3\log目录下找到idea.log文件,其中记录了错误日志,有更详细的错误信息,该文件中显示:
2025-04-04 15:02:49,240 [ 278096] INFO - Emulator: Pixel Tablet - D:\software\AndroidSDK\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_Tablet -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2025-04-04 15:02:49,270 [ 278126] INFO - Emulator: Pixel Tablet - Android emulator version 35.5.8.0 (build_id 13181580) (CL:N/A)
2025-04-04 15:02:49,270 [ 278126] INFO - Emulator: Pixel Tablet - Graphics backend: gfxstream
2025-04-04 15:02:49,270 [ 278126] INFO - Emulator: Pixel Tablet - Found systemPath D:\software\AndroidSDK\system-images\android-36\google_apis_playstore\x86_64\
2025-04-04 15:02:49,357 [ 278213] WARN - Emulator: Pixel Tablet - Please update the emulator to one that supports the feature(s): VulkanVirtualQueue
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Increasing RAM size to 3072MB
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - IPv4 server found: 114.114.114.114
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Ignore IPv6 address: 388f:cc3e:9b01:0:a087:cc3e:9b01:0
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Ignore IPv6 address: 388f:cc3e:9b01:0:a087:cc3e:9b01:0
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Ignore IPv6 address: 388f:cc3e:9b01:0:a087:cc3e:9b01:0
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Checking system compatibility:
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Checking: hasCompatibleHypervisor
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Ok: Hypervisor compatibility to run avd: `Pixel_Tablet` are met
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Checking: hasSufficientSystem
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Ok: System requirements to run avd: `Pixel_Tablet` are met
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Checking: hasSufficientHwGpu
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Ok: Hardware GPU requirements to run avd: `Pixel_Tablet` are passed
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Checking: hasSufficientDiskSpace
2025-04-04 15:02:49,357 [ 278213] INFO - Emulator: Pixel Tablet - Ok: Disk space requirements to run avd: `Pixel_Tablet` are met
2025-04-04 15:02:49,357 [ 278213] WARN - Emulator: Pixel Tablet - unknown skin name 'pixel_tablet'
2025-04-04 15:02:49,365 [ 278221] INFO - Emulator: Pixel Tablet - Process finished with exit code 1
2025-04-04 15:02:49,365 [ 278221] WARN - Emulator: Pixel Tablet - Emulator terminated with exit code 1
可知,Android studio无法找到该虚拟机,打开虚拟机存放目录C:\Users\admin\.android\avd\Pixel_Tablet.avd,或者在Android studio中show on disk,找到config.ini配置文件,修改skin.path为当前SDK位置。
出现SDK位置错误的原因是在联网电脑上下载好了虚拟机与其对应配置,将其直接复制到离线机器上,没有修改,所以出现这种问题。
skin.path = D:\software\AndroidSDK\AndroidSDK\skins\pixel_tablet
修改完成,成功启动虚拟机。