我在 Andorid 手機上使用網路共享與我的 PC 共享互聯網連接。有時我需要獲得一個新的 IP 地址,為此我切換到飛行模式,然后禁用它并獲得一個新的 IP。我正在尋找一種從我的電腦上完成這個技巧的方法。所以我需要從我的電腦上在我的手機上運行一個命令,我完全不知道該怎么做,如果我需要 root 我的 android 設備。
謝謝 !
uj5u.com熱心網友回復:
使用 ADB(無需 root)
// Open Wifi settings screen
adb shell am start -a android.settings.WIRELESS_SETTINGS
// Call key down event
adb shell input keyevent 20
// Call key click event to turn off wifi
adb shell input keyevent 23
// Key click again to turn on wifi
adb shell input keyevent 23
// Get the ip address
adb shell ip route
使用 SVC(需要 root)
// Disable Wifi
adb shell su -c 'svc wifi disable'
// Enable Wifi
adb shell su -c 'svc wifi enable'
// Get the ip address
adb shell ip route
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/449586.html
