adb調(diào)試工具 MAC連接安卓虛擬機(jī)

環(huán)境配置

安卓虛擬機(jī)連接調(diào)試工具:adb

下載platform-tools 工具包后,
下載地址:https://pan.baidu.com/s/1iHjj87629-vgK_VRybBxPw 密碼: w264

把platform目錄添加到環(huán)境變量里

打開mac的終端,

open -e .bash_profile

添加目錄,
export PATH=“/Users/wangxianghua/anaconda2/bin:$PATH” 添加platform-tools/目錄成為
export PATH=“/Users/wangxianghua/anaconda2/bin:/Users/wangxianghua/Downloads/platform-tools/:$PATH”,
注意platform-tools后面有斜杠/,一開始沒有加入斜杠,嘗試了很多別的辦法。

然后

source .bash_profile

此時終端,輸入adb,不再提示command not found: adb

開始提示使用方法

adb
Android Debug Bridge version 1.0.39

Revision 3db08f2c6889-android

Installed as /Users/wangxianghua/Downloads/platform-tools//adb

global options:

-a         listen on all network interfaces, not just localhost

-d         use USB device (error if multiple devices connected)

-e         use TCP/IP device (error if multiple TCP/IP devices available)

-s SERIAL

     use device with given serial number (overrides $ANDROID_SERIAL)

-p PRODUCT

連接到安卓虛擬機(jī)

1.adb connect 101.236.31.X

顯示

* daemon not running. starting it now at tcp:5037 *

* daemon started successfully *

connected to 101.236.31.X:5555

2.adb shell

顯示

shell@remix_x86_64:/ $

3.切換成root

顯示

shell@remix_x86_64:/ $ su

root@remix_x86_64:/ # 

4.安卓虛擬機(jī)修改DNS

adb shell 里用 root 權(quán)限,執(zhí)行
ndc resolver setnetdns 100 localdomain [119.29.29.29](http://119.29.29.29/) [114.114.114.114](http://114.114.114.114/)

最好寫入啟動文件,不然重啟 DNS 會仍然無效 /system/etc/init.sh

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容