問題描述
我正在開發一個 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 之類的虛擬機進行調試?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!