使用 VMWare/VirtualBox 之类的虚拟机进行调试? [英] Debugging using a virtual machine like VMWare/VirtualBox?

查看:35
本文介绍了使用 VMWare/VirtualBox 之类的虚拟机进行调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 Android 应用程序,但对 我的模拟器 的性能感到厌烦我确实在 VM-ware 和 Virtual Box 中都安装了 Android PC 版本

我可以将它用作模拟器吗?如果是这样,怎么做?如何将 ADB 连接到运行 PC Android 的虚拟机?

我在某个论坛看到使用它,但我的 VMs android 没有特定 IP.

如何连接??

解决方案

解决方案:

我强烈建议使用 Android x86,因为它比使用 Android x86 4.2 的 Android 模拟器快很多倍,您可以安装和使用任何应用程序,并像使用平板电脑一样使用Google play"与您的帐户同步

使用最新的 Android X86 4.2 Jelly Bean 和 Virtual Box

我找到了连接 Internet 和 adb 的不同方法

步骤:1 适配器的选择

案例 1:仅 Internet {NAT 适配器}

最简单的解决方案是使用 NAT 适配器,如果主机连接到互联网,它将直接将您连接到互联网,但您不会通过此设置获得 adb 连接在这里您将获得公共 ip,因此您无法连接到主机

案例 2:仅 adb {Host Only Adapter}

最简单的解决方案就是使用 Host Only Adapter

注意: 由于 DHCP 服务器设置,默认 Host Only 适配器可能无法工作,要么为现有适配器创建新的 HostOnlyAdapter 或运行 DHCP 服务器()

案例 3:对于 adb 和 Internet {Bridge Adapter}

在这种情况下你必须小心.

如果您使用 LAN 进行互联网连接,则应将网桥适配器与您的以太网卡一起使用,它将为您提供本地 ip,虚拟机将使用主机连接到互联网

或者,如果您使用 Wifi,只需选择 Wifi 适配器即可

对于其他类型的连接,您应该采用相同的方式

步骤:2 与 adb 连接

要检查 ip 地址,只需按 Alt+F1 {对于控制台窗口} [要切换回图形视图,请按 Alt+F7 ]

您将看到控制台窗口类型 netcfg

它会显示IP地址

现在转到您的主机运行命令提示符移动到 adb 目录输入

 adb connect {你的IP地址}

示例

<块引用>

adb 连接 192.168.1.51

注意:如果 adb 没有运行或没有响应,您可以执行以下操作

adb kill-serveradb 启动服务器

您可以检查连接到 adb 的设备

adb 设备

I am developing an Android application but fed-up of performance of My emulator I do have a Android PC version installed in both VM-ware and Virtual Box

Can I use it as emulator? If so, how? How can I connect ADB to a virtual machine running PC Android?

I saw in some forum to use this but my VMs android having no specific IP.

How to i connect it??

解决方案

Solution:

I would highly recommend to use Android x86 coz it many many times faster than Android emulator with Android x86 4.2 you can install and use any application with this and use "Google play" synch with your account as you do it with tablet

Working with latest Android X86 4.2 Jelly Bean and Virtual Box

I have found Different ways to connect with Internet and adb

Step: 1 Selection of Adapters

CASE 1: Only Internet {NAT Adapter}

The easiest solution is just use NAT adapter that will directly connect you to internet if host is connected to internet but you won't get the adb connection with this setup Here you will get Public ip so you can't connect to Host computer

Case 2: Only adb {Host Only Adapter}

The easiest solution is just use Host Only Adapter

Note: The default Host Only adapter may not work due to DHCP server settings either create new HostOnlyAdapter or run DHCP server for existing Adapter()

Case 3: For both adb and Internet {Bridge Adapter}

You will have to take care in this case.

If you are using LAN for internet connection you shall use Bridge Adapter with your Ethernet card it will give you local ip and Virtual Machine will connect to Internet using host machine

Alternatively if you are with Wifi just do the same by selecting the Wifi adapter

For other type of connection you shall go with the same way

Step: 2 Connection with adb

to check the ip Address just press Alt+F1 {for console Window} [To switch back to Graphics view press Alt+F7 ]

you will see the console window type netcfg

it will show the ip address

Now move on to you host run command prompt move to adb directory type

 adb connect {your ip address}

Example

adb connect 192.168.1.51

Note: if adb is not running or responding you can do following

adb kill-server

adb start-server 

you can check devices connected to adb

adb devices

这篇关于使用 VMWare/VirtualBox 之类的虚拟机进行调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆