我正在使用拴在安道尔电话分享互联网连接到我的个人电脑。有时我需要一个新的IP地址,因为我切换到飞机模式,然后禁用它,我得到一个新的IP。我正在寻找一种方法来做这个技巧,从我的电脑。所以我需要用我的电脑在手机上运行一个命令,我完全不知道怎么做,如果我需要根根我的android设备。
谢谢!
发布于 2022-03-24 10:44:31
使用亚行的(不需要根)
// 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 (根所需)的
// 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://stackoverflow.com/questions/71600804
复制相似问题