Android Studio : emulator is already running

China☆狼群 提交于 2020-07-16 17:27:42

问题


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.

enter image description here


回答1:


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".




回答2:


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.




回答3:


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.




回答4:


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.




回答5:


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 :)




回答6:


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.




回答7:


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




回答8:


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.




回答9:


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




回答10:


I restarted the computer and it worked for me!




回答11:


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.




回答12:


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



回答13:


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.




回答14:


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.




回答15:


Run this command and try again:

adb kill-server 



回答16:


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

Just killing the emulator and trying again did the trick.




回答17:


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.




回答18:


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




回答19:


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 + F10




回答20:


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.




回答21:


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

Kill pid:

Windows

taskkill /F /PID pid_number



回答22:


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



来源:https://stackoverflow.com/questions/27014901/android-studio-emulator-is-already-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!