以下電腦均指Mac
- Home brew安裝ADB
brew cask install android-platform-tools
安裝完后,連接Android設(shè)備到電腦,并打開(kāi)調(diào)試模式
#查看已連接到設(shè)備
adb devices
- Home brew安裝scrcpy
brew install scrcpy
- 使用USB連接查看Android屏幕
scrcpy
- 使用WIFI查看Android屏幕
Android需要打開(kāi)調(diào)試模式,并且于電腦處于同一網(wǎng)絡(luò)內(nèi)
# 1. 配置adb局域網(wǎng)連接端口
adb tcpip 8888
# 1.1 查看Android設(shè)備ip
adb shell ifconfig
# 2. 連接到設(shè)備
adb connect 192.168.1.x:8888
# 3. 斷開(kāi)USB連接
# 4. 開(kāi)始投屏
scrcpy