Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove an offline emulator from avd devices?

I've created a couple of AVD-s in Android Studio. They were launching on emulator port 5554. Then I've created another AVD via android avd application, and they are starting on port 5556.

Now with a single emulator running, I get the following output from adb devices -l:

List of devices attached
emulator-5556          device
emulator-5554          offline

I'm using the tooling which cannot supply the -s (specific device) option to adb, so when trying to install an app, I get an error:

error: more than one device/emulator

And I'd like that there be a single connected emulator: the only one that I'm running.

I thought that removing the old Android Studio-created devices would do the trick of removing the emulator-5554, but nope. Even new devices created in Studio will open on 5556. So I've ended up with a forever-offline zombie emulator-5554 that screws up my build tooling.

How can I force the new emulators to be run on port 5554 and/or remove the offline emulator-5554?

(Running Ubuntu 16.04 if it matters.)

like image 790
Arry Avatar asked Aug 31 '16 10:08

Arry


People also ask

How do I delete an emulator device?

Deleting an emulator In Android Studio, open the AVD Manager from “Tools” → “AVD Manager”, where you'd normally launch an emulator. In the “Actions” column, click the arrow pointing down to open the menu for the emulator you want to delete. Select “Delete” and confirm in the dialog.

How do I get an emulator online?

1. just click on "About the emulator" -> "Build Number" about 5-7 times. 2. This will open "developers options", go back and click on it and enable "USB debugging" to bring it online.


1 Answers

When I am facing the same issues than doing like below:

  1. Restart adb by issuing adb kill-server followed by adb start-server in a command prompt
  2. Disable and re-enable USB debugging on the phone
  3. Rebooting the phone if it still doesn't work.

99% of my issues have been resolved with these steps.

like image 192
Chandrama Prasad Avatar answered Sep 21 '22 22:09

Chandrama Prasad