10

Is there a way to bring android emulator from offline to online mode without closing AVD? I tried adb's 'kill-server', 'start-server' commands but this just seems to re-start adb server (adb.exe process), the emulator is still in offline mode and 'adb devices' still show 'offline' state.

Also can someone explain what exactly 'offline' mode of emulator means. In my case - Emulator (standalone), daemon process and ADB server - all seem to be running. Why is emulator state still offline?


Updating Question: I have tried 'adb reset' both from Eclipse & command line that does not solve the problem. Issue seems to be more with Emulator Memory. Per my analysis memory of emulator keeps increasing and after a limit (~470 MB in my Windows) if you try to do a adb reset - it brings the state of emulator to offline and no more adb commands work. (also no network calls seem to be working)

Sohdeep
  • 131
  • 1
  • 1
  • 6

5 Answers5

4

If you just created the emulator, in the emulator settings:

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.

3

Use these commands from the command prompt it will help u

1.adb kill-server //kill all active server
2.adb start-server //start adb server
3.adb devices //check the list of active server
Developer
  • 6,292
  • 19
  • 55
  • 115
  • Thank you for response! But as I already mentioned, I tried 'adb reset' both from Eclipse & command line that does not solve the problem. Issue seems to be more with Emulator Memory. Per my analysis memory of emulator keeps increasing and after a limit (~470 MB in Windows) if you do a adb reset - it brings the state of emulator to offline and no more adb commands work. – Sohdeep Aug 04 '13 at 02:16
3

I have faced this problem many times. Some solutions are:

Solution 1:

the emulator
Select & Right Click on Android Project
Run Configurations
Go to tab Target 
Enable option Wipe User Data on Emulator launch parameters
Run Application

Solution 2:

 Run Emulator
    Keep the Emulator, (no matter same error occurs)
    Make Sure the Home Screen of Emulator is appeared
    go to Window -> Show Perspective -> DDMS --> In Devices Panel -> on Corner Drop Down Menu
    Reset adb

Solution 3:

Reset adb manually or using the command line.

Might be helpful for a new user.

MLavoie
  • 9,671
  • 41
  • 36
  • 56
Harshid
  • 5,701
  • 4
  • 37
  • 50
  • Thank you for response! As I already mentioned, I tried 'adb reset' both from Eclipse & command line that does not solve the problem. Issue seems to be more with Emulator Memory. Per my analysis memory of emulator keeps increasing and after a limit (~470 MB in Windows) if you do a adb reset - it brings the state of emulator to offline and no more adb commands work. – Sohdeep Aug 02 '13 at 18:56
3

Sometimes/most of the times the solutions described above works. But if it does not, and you had "Launch from snapshot" enabled, killing the emulator and restarting it WITH LAUNCH FROM SNAPHOT DISABLED, will let you of the hook. I had this problem many, many times in the last few weeks, and although adb kill-server followed by adb devices works 4 times out of 5, that fifth time the only way to get it working again is by disabling the 'launch from snapshot' option. My guess is that the emulator is somehow in a 'wrong' state, but do not understand why myself.

Roel
  • 31
  • 1
  • 2
    FYI: the order of answers under the question will vary overtime based on user preferences, votes, and sort order so it can be confusing to reference "solutions described above" because they may not be! – Edward Mar 21 '14 at 20:06
  • I know this is pretty old, but as it helped me, I'll add that this is now called "Cold Boot" on the AVD Manager of Android Studio 3.1. – ianribas Apr 19 '18 at 13:39
2

This issue can be solved using the below steps:

  1. Open AVD-Manager in android studio and choose the emulator which you want to run and do the wipe data and cold boot, take reference from the attached pic:enter image description here
  1. If the doesn't work, go to emulated device and enable the developer options > enable USB debugging.