简体   繁体   中英

Can't Delete AVD from AVD Manager in Android Studio

I am running Android Studio on OS X Yosemite. I am trying to simply delete an AVD from Android Studio AVD Manager. Every time I attempt to delete it I get the message "The selected AVD is currently running in the Emulator. Please exit the emulator instance and try deleting again." The problem is that the emulator is NOT running. I even closed down all the studio and rebooted the computer. It still says the same thing. Anybody seen this before? I would really like to remove the AVD.

Thanks in Advance!

Search for *.lock folders under .android folder and delete those. This should tell Android studio that the AVD is not running.

To delete any android emulators (and thereby stop them, if they have been running in the background of the system) close Android Studio and go to the following folder:

%userprofile%\.android\avd

(e.g. C:\user\username\.android\avd )

Delete all the files and folders inside it and restart the IDE.

Now when you open the Android Studio Device Manager it will ask you to create a new AVD.

在 Android Studio 上,转到:Tool > Android > AVD Manager,在操作列上,您可以删除您的 avd

For Linux users:

Go to the .android folder (it should be in your home folder, ctrl + h to show hidden files), go to the avd folder ( cd ~/.android/avd from the command line). Delete whichever avd you want to. Then restart Android Studio.

In Linux/*nix and OSX:

Find the .android folder in your $HOME directory.

1) In .android there should be a avd folder 2) In the avd folder should be one or multiple .ini file and a corresponding *.avd virtual device folder. 3) Delete both the .ini file and the .avd folder you want to get rid of. 4) Return to the Android sdk and AVD manager.

I had an issue were I couldn't delete the files in the folder located at:

C:\Users[your_comp_name_goes_here].android\avd[your_emulator_device]\hardware-qemu.ini.lock

You cannot delete this file even if you close AndroidStudio and some other bug sending programs that didn't even close after you close AndroidStudio

There is a file called 'pid' inside the hardware-qemu.ini.lock folder that you can open up with notepad and it gives you the number of the process number. Go into task manager>Details tab>order by PID by clicking on the columb>search for the PID>end process; The process name should be something like quemu?????.exe I think.

After that, your AndroidStudio will no longer be locked. Maybe you could of solved it with a restart too.

MAC USERS

Steps

1. Go to AVD Device Directory

$ cd ~/.android/avd/<Device_Name>.avd

2. Delete *.lock files

$ rm *.lock


Example

$ cd ~/.android/avd/Pixel_5_API_31.avd
$ rm *.lock

For those asking about the location of .android folder. I found mine at this path

C:\Users\<Your_UserName>\ .android

then you will find an avd folder. This folder contain the *.lock files StoneBird talked about.

使用命令行,首先列出所有 avd,然后使用 avd 名称删除,例如:

avdmanager -v list

avdmanager -v delete avd -n "android-26"

A lot of people are perhaps not able to locate the '.android' folder easily. The easiest way to detect this folder and in turn the avd location is to click on the dropdown button next to the avd listing for each indiviual avd item in AVD Manager in android studio and selecting the "show on disk" option

Find the process

ps -eaf | grep avd

Kill it

kill -9 <process id>

窗口打开时单击 avd 管理器图标,单击它时会出现下拉箭头,将打开一个下拉菜单,单击选项查看系统文件现在左键单击文件单击数据,然后删除 pidgin 文件。

转到 AVD 管理器并选择要删除的模拟器,然后按 OK 了解更多信息https://developer.android.com/studio/run/managing-avds

在 Android Studio 上,转到:Tool > Android > AVD Manager,在操作列上,您应该单击“停止”,然后您可以删除该设备

Currently in AVD Manager it's also possible just to click Stop and will do it for you.

Then you just play the emulator again.

在此处输入图像描述

if you are using linux distro

aseztak@kalyan:~$ top

find adb pid

Then you kill the PID you found (replace 1334 with the PID you found):

aseztak@kalyan:~$ kill 1334

Recent versions of Android Studio on windows may place the avd folder in your C: directly.

C:\Android\.android

You can look for avd folder in here if you can't find it in the home directory,

C:\Users\%USERNAME%\.android

( Yea, you can directly paste this in the address bar, windows understands. )

After getting to the avd folder, as others have said, delete the *.lock folders or delete the folder with the name of avd which is causing issues, refresh the avd manager using the refresh button at the bottom right and then delete the avd from the avd manager.

The issue is Android Studio didn't pick the command and shows xx Device is running in the background. The only solution is to delete the Emulator manually.

  1. Select tools from the upper options of Android studio, select the SDK Manager, and delete the emulator from there. It will work for sure.

  2. After deleting from SDK Manager, now delete the Emulator from Device Manager and it will get vanished in matter of seconds.

for mac users- go to this folder - and delete the specific device file -

to show hidden files use this - ctrl + shift +.

I had to close Android Studio and then restart it. The dialog box saying to delete the "multiinstance.lock" file couldn't be done because it was locked down.

If you're not founding the .android you can restart your computer and the emulator will stop. So you can delete the AVD :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM