You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio中无法删除损坏AVD及锁文件,求解决方案

Fixing Stubborn AVD Lock Files & Failed Deletions

Yep, I’ve run into this exact frustrating issue before—those lingering QEMU processes and un-deletable lock files are a real headache when you’re trying to clean up a broken AVD. Here’s a step-by-step solution that’s worked for me and other Android devs:

Step 1: Force Kill the QEMU Process

The error says multiinstance.lock is open by qemu-system-x86_64, so we need to shut that process down first:

  • Using Task Manager: Press Ctrl+Shift+Esc to open Task Manager, switch to the Details tab, find every instance of qemu-system-x86_64.exe, right-click each one, and select End Task. Make sure you get all of them—sometimes multiple processes stick around.
  • Using Command Prompt (Admin): Open Command Prompt as an administrator, then run this command to force-kill all QEMU processes at once:
    taskkill /f /im qemu-system-x86_64.exe
    
    The /f flag forces termination, and /im targets the process name.

Step 2: Delete Lock Files & Directories

Once the QEMU processes are gone, head back to the AVD’s directory: C:\Users\asdfg.android\avd/Pixel_2_API_29_-_AC5.avd/

  • First, delete the multiinstance.lock file—this should now work without the "in use" error.
  • Next, delete the hardware-qemu.ini.lock directory. If the system says the folder is still in use, check inside it for any leftover files and delete those first, then delete the empty directory.

Step 3: Delete the AVD via Android Studio

Go back to Android Studio’s AVD Manager, select the broken Pixel_2_API_29_-_AC5 AVD, and try deleting it again. It should now go through without the "still running" error.

Alternative Workarounds (If Steps 1-3 Fail)

  • Manual AVD Cleanup: If the AVD Manager still won’t delete the AVD, you can manually remove all its files:
    1. Navigate to C:\Users\asdfg.android\avd/
    2. Delete both the Pixel_2_API_29_-_AC5.avd folder and the Pixel_2_API_29_-_AC5.ini file. This completely removes the AVD from your system.
  • Restart Your Computer: As a last resort, restarting your PC will terminate all lingering processes automatically. Once your system boots back up, you’ll be able to delete the lock files and the AVD without issues.

Quick Tip for Future Issues

If your AVD crashes again, always check Task Manager first for leftover qemu-system-x86_64.exe processes—killing them right away can prevent these stubborn lock files from being created in the first place.

内容的提问来源于stack exchange,提问作者random512

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:20:57