VirtualBox上Android的86:Android的连接,但不在线 [英] Android x86 on VirtualBox: Android Connected But Not Online
问题描述
我想配置使用Oracle的VirtualBox,以便它可以与Eclipse的跑步机一款Android x86的。我有在做我的虚拟机在线有些麻烦。我通过键入以下内容在Android终端仿真器连接手机到亚行:
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
之后,我切换到cmd并输入 亚行连接本地主机
Afterwards, I switched to cmd and typed adb connect localhost
但是,当我尝试运行c。使用Eclipse中的虚拟机器人我的测试$ C $,它不会出现在Android设备选配菜单。此外,当我在cmd中输入 ADB设备
,这是响应:
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
这是我担心的另一件事是,每次当我关闭VM,我必须键入的ifconfig
和路由添加
再命令的时候,我重新启动终端,以连接到该设备。
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?
编辑: 如果它的事项,虚拟机配置为在NAT网络进行通信。这是我的端口转发规则是这样的: 协议:TCP
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
主机IP:*
主机端口:5555
游客IP:*
客户端口:5555
EDIT2 相关问题:错误:设备离线
EDIT3:潜在解决方法:<一href="http://stackoverflow.com/questions/5584976/android-device-chooser-my-device-seems-offline">Android设备选择器 - 我的设备似乎离线
推荐答案
这是比所有这一切更容易,使亚行基于TCPIP在Android虚拟机仿真终端类型:
This is much easier than all of that, to enable adb over tcpip in the Android VM Terminal Emulator type:
adb tcpip 5555
然后通过亚行通过命令行连接你的Eclipse的机器上:
Then to connect via adb from a command line on your Eclipse machine:
adb connect 192.168.40.1:5555
虚拟机现在应该通过ADB设备以及通过Eclipse中的设备视图是可用的。
The VM should now be available via adb devices as well as via the device view in Eclipse.
这篇关于VirtualBox上Android的86:Android的连接,但不在线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!