Android: Emulator frequently disconnected (offline)!

前端 未结 7 1825
执笔经年
执笔经年 2021-01-04 18:17

Sometime just after I launched a new emulator, for very first time I was trying to upload my apk, however I got \"emulator: ERROR: the user data image is used by another emu

相关标签:
7条回答
  • 2021-01-04 18:28

    type "monitor" command in cmd,then select device in the monitor window click on down arrow as  just click on reset tab thats all you will get internet connection Open android debug monitor window by typing "monitor" command in cmd, then select device in the monitor window, click on down arrow as shown in the figure then just click on reset tab thats all you will get internet connection.

    0 讨论(0)
  • 2021-01-04 18:30

    If the emulator is still alive, you can tell adb to connect to it via tcp (which is I believe what it does anyway, only it normally uses an 'emulator' class of name and would now get a ip:port one)

    It's been a while since I've had to do that, but I think that if you were using emulator-5554 you would connect to your development machine's loopback one port higher, ie:

    adb connect localhost:5555
    

    If it works adb devices will show it an eclipse should see it as a deployment option

    The 'in use' problem sounds like a stale lockfile perhaps left behind in a crash

    0 讨论(0)
  • 2021-01-04 18:37

    Manually delete these following folders:

    C:\Users\%UserName%.android\avd\AVD2.1.avd\cache.img.lock

    C:\Users\%UserName%.android\avd\AVD2.1.avd\userdata-qemu.img.lock

    this always works for me. :3

    0 讨论(0)
  • 2021-01-04 18:46

    It was some strange

    I had that problem, automatically stopped the emulator localhost:5554 after to launch the application.

    I didn't know why it happens but intil today I did something different at I could launch as normality.

    What I did as different was to change the prespective of Eclipse ADT. I was executing the application from Debug and now I executed from Java Prespective, it worked, I don't know the reason, I had to share it, sound some .. this answer but I resolved doing that without deleting and creating again my android virtual device.

    0 讨论(0)
  • 2021-01-04 18:48

    In my case it happens when I have another process listening on emulator port.

    e.g. if I see:

    emulator-5554 offline
    

    it means that something is using port 5554

    0 讨论(0)
  • 2021-01-04 18:48

    On Arch Linux x64, I had this similar problem which led me to this question. Using Eclipse, the emulator-5554 window would freeze, and Eclipse prompted me to start a new one. In the following dialog, emulator-5554 was reported to be offline, with an unknown target. If I started a new instance, it would be emulator-5556. This problem persisted through Eclipse restarts and log-off-on cycles too! Further, killx would close the window, but the process was still running.

    So, find the emulator64-arm process id (not emulator-arm!):

    ps ax | grep "emulator64-arm"
    

    ...and then just kill -9 it:

    sudo kill -9 6728
    

    ...where 6728 was its PID. This completely disconnects the emulator so Eclipse can try to run it again.

    0 讨论(0)
提交回复
热议问题