Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator-5554 offline

People also ask

How do I resolve Android emulator 5554 offline?

Go to cmd and type adb kill-server. Go to task manager and find adb in processes. If you find one, right click on it and click on end process tree. In eclipse, go to Window>Android Virtual Device Manager, click on the AVD you want to launch, click on start and uncheck "Launch From Snapshot" and then click on launch.

How do I turn my 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.

How do I uninstall offline emulator?

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

How do I enable Internet on Android emulator?

Go to your Android\Sdk\emulator folder and open command prompt. Type emulator -list-avds to see available emulator names. Type emulator -avd name-of-your-device -netdelay none -netspeed full -dns-server 8.8. 8.8 command and press enter.


1 . Simply "Wipe data" to fix this issue.

enter image description here

2 . If it doesn't work, go to emulated device and enable developer options > enable usb debugging


In such a case, you can do all of the following in order to be assured that your emulator starts working again :

  1. Go to cmd and type adb kill-server
  2. Go to task manager and find adb in processes. If you find one, right click on it and click on end process tree.
  3. In eclipse, go to Window>Android Virtual Device Manager, click on the AVD you want to launch, click on start and uncheck "Launch From Snapshot" and then click on launch.

That's it! It will take a while and it should resolve your problem.


The way that Android detects emulators is by scanning ports starting at port 5555.

The number you see in the adb devices list (in your case 5554) will be one less than the port that adb is finding open.

You probably have a process running that is listening on port 5555. To get rid of the "offline" device, you will need to find that application and close it or reconfigure it to listen to a different port.


This solution is for Windows.

(See @Chris Knight's solution for Mac/Linux)

  1. Start Windows Powershell:

    Start -> type 'powershell' -> Press ENTER

  2. Run the following command: adb devices


PS C:\Users\CJBS>adb devices
List of devices attached
emulator-5656   host
emulator-5652   host
12b80FF443      device

In this case, 12b80FF443 is my physical device, and the emulator-* entries are garbage.

  1. Per @Brigham, "The way that Android detects emulators is by scanning ports starting at port 5555.". The port number is indicated after the emulator name (in this case 5656 and 5652). The port number to check is the emulator port number plus 1. So in this case:-

    5656 + 1 = 5657

    5652 + 1 = 5653

    So let's see which program is using these ports. In this case, the ports to check both start with "565". So I'll search for ports in use starting with 565. Execute: netstat -a -n -o | Select-String ":565"


PS C:\Users\CJBS> netstat -a -n -o |  Select-String ":565"

  TCP    127.0.0.1:5653         127.0.0.1:5653         ESTABLISHED     5944
  TCP    127.0.0.1:5657         127.0.0.1:5657         ESTABLISHED     5944
  1. The final field in this output is the PID (Process ID) - in this case it's PID 5944 for both of these two ports. So let's see what this process ID is. Execute: tasklist /v | Select-String 5944. Replace 5944 with the output of the previous command:

PS C:\Users\CJBS> tasklist /v | Select-String 5944

adb.exe                       5944 Console                    1      6,800 K Running         MyPCName\CJBS          0:06:03 ADB Power Notification Window

What a surprise. It's ADB. As noted by other answers, it could be other programs, too.

  1. Now, just kill this process ID. Execute kill 5944, replacing 5944 with the PID in the previous command.

PS C:\Users\CJBS> kill 5944
  1. To confirm that the spurious emulator is gone, re-run the following command: adb devices

PS C:\Users\CJBS>adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
12b80FF443      device

ADB re-starts (as it was previously killed), and it detects no more fake emulators.


From the AVD Manager try the "Cold Boot Now" option in the drop-down. It worked for me!


I finally solved this problem, I had to go to the Developer options from the Settings in the Emulator, then scrolled down a little, turned on the USB debugging. Instantly my device was recognized online, and I no longer faced that issue. I tried restarting android studio and emulator, killing adb process, but those did not work.


If you are on Linux or Mac, and assuming the offline device is 'emulator-5554', you can run the following:

netstat -tulpn|grep 5554

Which yields the following output:

tcp        0      0 127.0.0.1:5554          0.0.0.0:*               LISTEN      4848/emulator64-x86
tcp        0      0 127.0.0.1:5555          0.0.0.0:*               LISTEN      4848/emulator64-x86

This tells me that the process id 4848 (yours will likely be different) is still listening on port 5554. You can now kill that process with:

sudo kill -9 4848

and the ghost offline-device is no more!

On macOS Big Sur and later, use

sudo lsof -i -P | grep LISTEN | grep 5554

to find out the process.