Adb - Android x86 on VirtualBox Android Connected But Not Online

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I am trying to configure a Android x86 running machine using Oracle VirtualBox so that it works with Eclipse. I am having some trouble in making my virtual machine "online". I connected the phone to adb by typing the following in the Android Terminal Emulator:

ifconfig eth0 192.168.40.1 netmask 255.255.255.0
route add default gw 192.168.40.1 dev eth0

Afterwards, I switched to cmd and typed

   adb connect localhost

But when I try to run my test code using Eclipse on the virtual Android, it does not appear in the Android Device Chooser Menu. Furthermore, when I typed adb devices in cmd, this was the response:

List of devices attached
localhost:5555   offline

The other thing that worries me is that each time after I shut down the VM, I have to type the ifconfig and route add commands again in the terminal when I restart, in order to connect to the device.

What can I do to make the device online?

  EDIT:    

In case it matters, the VM is configured to communicate over a NAT Network. This is what my Port Forwarding Rules look like: Protocol: TCP

Host IP: *

Host Port: 5555

Guest IP: *

Guest Port: 5555

  EDIT2   

http://stackoverflow.com/questions/10680417/error-device-offline http://stackoverflow.com/questions/10680417/error-device-offline

http://stackoverflow.com/questions/5584976/android-device-chooser-my-device-seems-offline http://stackoverflow.com/questions/5584976/android-device-chooser-my-device-seems-offline

Answers

This is much easier than all of that, to enable adb over tcpip in the Android VM Terminal Emulator type:

adb tcpip 5555

Then to connect via adb from a command line on your Eclipse machine:

adb connect 192.168.40.1:5555

The VM should now be available via adb devices as well as via the device view in Eclipse.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/10760490/android-x86-on-virtualbox-android-connected-but-not-online

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils