ConnectivityManager.setUsbTethering(boolean enable)은 Android 4.3에서 호출 됩니다.
adb shell su -c service call connectivity 34 i32 1 USB 테 더링을 켭니다.
adb shell su -c service call connectivity 34 i32 0 USB 테 더링을 끕니다.
다른 Android 버전의 경우 Android 버전 당 34다음 setUsbTethering 아래처럼 바꿔 사용할수 있습니다.
4.4.4: 34
5.1.0: 30
6.0.1: 30
7.0.0: 33
Comment on this post!
김영삼 2019/11/30 14:07
adb reboot
adb shell am start -n com.android.settings/.TetherSettings && sleep 2 && adb shell input keyevent 20 && adb shell input keyevent 20 && adb shell input keyevent KEYCODE_ENTER && sleep 2 && adb shell input keyevent 4
김영삼 2019/11/30 14:18
https://gist.github.com/chartinger/2c4598859771dbd21474
김영삼 2019/12/08 12:12
shutdown -r -f -t 0