開發環境:android
電腦: Mac mini主機git
開發工具: DevEco Studio 2.1 Beta4shell
第三方軟件: Scrcpy android-platform-toolsruby
Army-Mac-mini-2:~ army$ brew -v Homebrew 3.1.5 Homebrew/homebrew-core (git revision 4c638b0758; last commit 2021-04-30) Homebrew/homebrew-cask (git revision bdb866f4fc; last commit 2021-04-30)
若是沒有, 執行下面安裝命令:curl
Army-Mac-mini-2:~ army$ /usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
Army-Mac-mini-2:~ army$ brew install scrcpy Army-Mac-mini-2:~ army$ brew install --cask android-platform-tools
先查看電腦上有哪些設備了tcp
Army-Mac-mini-2:~ army$ adb devices List of devices attached XIU0220C17029368 device
打開服務端口6666ide
Army-Mac-mini-2:~ army$ adb -s XIU0220C17029368 tcpip 6666
Army-Mac-mini-2:~ army$ adb connect 192.168.3.168:6666
Army-Mac-mini-2:~ army$ scrcpy -s 192.168.3.168:6666
Army-Mac-mini-2:~ army$ adb disconnect 192.168.3.211:5555 Army-Mac-mini-2:~ army$ adb shell bm get -udid 2EW13B922B671A48C802168D245C6B5B60312OIK3D6B90678S1534B420422218
總結: 工具
安裝Scrcpy軟件和android-platform-tools平臺軟件開發工具
申請調測證書和Profile (詳情看官方文檔)ui
scrcpy鏈接真機到電腦上
DevEco Studio調試選擇上面鏈接上的真機.
電腦重啓後, 從新投屏真機到電腦上,使用下面命令就行:
Army-Mac-mini-2:~ army$ adb connect 192.168.3.168:6666
Army-Mac-mini-2:~ army$ scrcpy -s 192.168.3.168:6666
最後來張截圖:
原文連接:
https://developer.huawei.com/...原做者:野狼_16叔