Android Studio : emulator is already running

Android Studio

Android Studio Problem Overview


I am trying to run emulator on my android studio 8.14. When I click run it says it is already running. Any help would be appreciated.

> AVD api21 is already running. > > If that is not the case, delete the files at /home/sayem/.android/avd/api21.avd/*.lock and try again

image containing the error written out above

Android Studio Solutions


Solution 1 - Android Studio

You don't have to completely delete the emulator when this happens. The files to delete should have a ".lock" extension:

Screenshot of files for an AVD. The first three files appear as file folders in Windows 7 and have '.lock' at the end of their file names.

You don't need to touch the configuration files.

You can easily find the files location by clicking on the arrow under the Actions tab (in the ADB manager), and selecting "Show on Disk".

Solution 2 - Android Studio

This worked for me:

Go to AVD Manager and click on the down-arrow on the right and click Stop. This stops the emulator and you can re-run it.

Solution 3 - Android Studio

Go to the down arrow and click on the "Show on Disk" link like attached image. You will get the list of all files, remove the file "hardware-qemu.ini.lock" and start again.

It works for me hope it will work for you too.

enter image description here

Solution 4 - Android Studio

There are so many answer but i just extending to give answer of this question. What happen is when i follow Android Studio instruction and try to delete that folder Or file but i am not able to delete it, So what am i do is that i open the AVD Manager and click on down arrow which is on right side as you can see in below screenshot and click on stop after click on start and its working fine. There is no need to restart or recreate the AVD.

https://i.stack.imgur.com/nZlSG.png"/>

Solution 5 - Android Studio

Follow the instructions on the error and go to your C:\Users\directory\.android\avd/Nexus_5_API_24.avd/*.lock and delete all files with the .lock extension and it should work.

Solution 6 - Android Studio

I restarted the computer and it worked for me!

Solution 7 - Android Studio

C:\Users\admin.android\avd\Nexus_5X_API_26.avd follow path and delete hardware-qemu.ini.lock this folder. make sure your problem can be solve :)

Solution 8 - Android Studio

This working for me :

Invalidate chaches/ restart

Go to

1 - File

2 - Select Invalidate Cahes / Restart

enter image description here

Solution 9 - Android Studio

Thanks everyone.

I removed files of given location. but when I refresh the AVD manager, Existing emulator are all gone.

I recreated new emulator. Now it works fine.

Solution 10 - Android Studio

When you go to the specified location and try to delete those files sometimes you might get an error stating that the file or folder is already open or is used by another application

So the simple Solution is just to go to

Tools > Android > AVD Manager and Stop the AVD that you are trying to run

Then When you try to run the AVD again you might have the problem resolved

Solution 11 - Android Studio

For me, "delete .lock file" & "stop emulator then start" & "delete emulator then recreate" does't work.

but,delete "C/User/yourName/.android" folder can fix this problem

Solution 12 - Android Studio

Go to (Windows) > C:\Users\directory.android\avd/Nexus_5X_API_26.avd

Or (Ubuntu) > ~/.android/avd/name.avd/Nexus_5X_API_26.avd

and delete all files of with .lock extensions.

Solution 13 - Android Studio

Just follow the tips from Android Studio ... Delete the file corresponding to your avd and recreate it.

This happens when the virtual device is shut down in an unexpected state.

Solution 14 - Android Studio

Find and open the pid folder within your *.lock folder. Inside should be a number.

Kill pid:

Windows

taskkill /F /PID pid_number

Solution 15 - Android Studio

If "adb kill-server" dont work try killing the adb from System monitor app of ubuntu:

System monitor->processes

All processes will be listed here end adb from here, must be in the top of the list.

Solution 16 - Android Studio

  1. Open Settings
  2. Goto developer options
  3. Click revoke USB debugging authorizations

Solution 17 - Android Studio

In your Android Studio go to Tools->Android->AVD Manager. It will list your virtual devices. Click the Action column corresponding to your virtual device. It will list many actions. Click on Stop. This will shutdown your android studio. Now start android studio. Your virtual device should work fine.

Solution 18 - Android Studio

> For MAC Users

Open Terminal, cd to the given path. List all the files using the command ls. You will see two files with .lock extensions or maybe more. Just delete those files. enter image description here

Solution 19 - Android Studio

I closed the emulator, clicked the AVD Manager Icon on the menubar then under the emulators actions tab downward arrow I selected "Cold Boot Now" then ran the program normally by pressing SHIFT + F10enter image description here

Solution 20 - Android Studio

You can also solve this problem by doing "Invalidate chaches/ restart".

Solution 21 - Android Studio

EASIEST SOLUTION:

  1. Go to AVD Manager
  2. Click on down arrow in the Actions column on the right
  3. Click on Wipe data

You're done :)

Solution 22 - Android Studio

For Windows: Step By Step Instructions below:

  1. Locate the avd folder: *C:\Users\username\.android\avd*
  2. Try delete *lock and figure out the process holding the lock
  3. Ctrl+Shift+Esc to get to TaskManager
  4. Select Pid and Process name by right clicking on the header
  5. Get the PID number of the offending application
  6. on cmd type: taskkill /F /PID /PIDnumber
  7. Now go back to the avd folder & delete the *lock files. It will work.
  8. Restart Emulator

Solution 23 - Android Studio

I Also have the same problem but in ubuntu 20.04 and I had to navigate to /home/your_username/.android/avd/Pixel_2_API_28.avd/*.lock and then delete all file with .lock

Note: you first need to enable show hidden files and I may have used different device (Pixel_2_API_28) from yours but it is applied to any device

Solution 24 - Android Studio

Run this command and try again:

adb kill-server 

Solution 25 - Android Studio

In my case the emulator looked fine but it was hung.

Just killing the emulator and trying again did the trick.

Solution 26 - Android Studio

Or you can type a command in terminal as

1.killall Finder and then type,

2.defaults write com.apple.Finder AppleShowAllFiles true it shows hidden .android folder

Open .android folder and delete .android/avd/Nexus_5X_API_26.avd/*.lock file and now you run emulator it works fine.

Solution 27 - Android Studio

> C:\Users\.android\avd > follow the path and open Emulator directory and delete all .lock extension folders.

Solution 28 - Android Studio

If you have followed all answers, and no success yet. And not able to find that specific lock.

Search all .lock extension files in /avd dir, and remove them. After then start again emultaor. It works for me without restart system.

Solution 29 - Android Studio

I'm don't know if some one is still having this problem, but, in my case, it's was an issue related to VAGRANT.... more precisely whit Virtual Box. I just stop the vBox proccess (i'm ussing ubuntu), remove the .lock files related to the emulator inself and that's it... the emulator should by ready to go.

Solution 30 - Android Studio

I tried solutions above but nothing worked so I deleted the emulator, restart pc and create a new one and it was resolved

Solution 31 - Android Studio

Check Updates... Emulator had an update. After I updated and restarted.. worked fine.

Solution 32 - Android Studio

When I was trying to delete multiinstance.lock it says

enter image description here

So, I opened Window's task manager and selected qemu-system-x86_64.exe and press End task

enter image description here

Solution 33 - Android Studio

Use this for killing all emulator processes.

adb emu kill

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSayemView Question on Stackoverflow
Solution 1 - Android StudioBSMPView Answer on Stackoverflow
Solution 2 - Android StudioBigDreamzView Answer on Stackoverflow
Solution 3 - Android StudioRahul MishraView Answer on Stackoverflow
Solution 4 - Android StudioNinjaView Answer on Stackoverflow
Solution 5 - Android StudioZackView Answer on Stackoverflow
Solution 6 - Android StudiokevinTHEprogrammerView Answer on Stackoverflow
Solution 7 - Android StudioNaresh PrajapatiView Answer on Stackoverflow
Solution 8 - Android StudioAbd AbughazalehView Answer on Stackoverflow
Solution 9 - Android StudioSayemView Answer on Stackoverflow
Solution 10 - Android StudioDivakar RajeshView Answer on Stackoverflow
Solution 11 - Android StudioRabbitView Answer on Stackoverflow
Solution 12 - Android StudioMdJahidHasan009View Answer on Stackoverflow
Solution 13 - Android Studiopdegand59View Answer on Stackoverflow
Solution 14 - Android Studiobg9848View Answer on Stackoverflow
Solution 15 - Android StudioshijinView Answer on Stackoverflow
Solution 16 - Android Studiouser1677230View Answer on Stackoverflow
Solution 17 - Android StudioABNView Answer on Stackoverflow
Solution 18 - Android StudioAjjiView Answer on Stackoverflow
Solution 19 - Android StudioTonnieView Answer on Stackoverflow
Solution 20 - Android StudiopankajView Answer on Stackoverflow
Solution 21 - Android StudioStack FoxView Answer on Stackoverflow
Solution 22 - Android StudioHezView Answer on Stackoverflow
Solution 23 - Android Studiotwizeyimana elissaView Answer on Stackoverflow
Solution 24 - Android StudioKonstantin LoginovView Answer on Stackoverflow
Solution 25 - Android StudioJohan WallesView Answer on Stackoverflow
Solution 26 - Android StudioKiran KumarView Answer on Stackoverflow
Solution 27 - Android StudioVivek Pratap SinghView Answer on Stackoverflow
Solution 28 - Android StudiovivekView Answer on Stackoverflow
Solution 29 - Android StudioMartín MoriView Answer on Stackoverflow
Solution 30 - Android Studiojan4coView Answer on Stackoverflow
Solution 31 - Android StudiobatthisView Answer on Stackoverflow
Solution 32 - Android StudioJitendraView Answer on Stackoverflow
Solution 33 - Android StudioRasoul MiriView Answer on Stackoverflow