Skip to content

Instantly share code, notes, and snippets.

@zlocate
Created December 13, 2020 10:22
Show Gist options
  • Save zlocate/d7980307997473595aa5eacd1a479f5e to your computer and use it in GitHub Desktop.
Save zlocate/d7980307997473595aa5eacd1a479f5e to your computer and use it in GitHub Desktop.
#!/bin/bash
# Enable usb tethering by adb shell (works on Android 10, Honor 10 Lite)
# Additional links: https://android.stackexchange.com/questions/29954/is-it-possible-to-activate-the-usb-tethering-android-setting-from-the-command
# https://stackoverflow.com/questions/20226924/is-it-possible-to-usb-tether-an-android-device-using-adb-through-the-terminal/24346101
adb shell svc usb setFunctions rndis
@zlocate
Copy link
Author

zlocate commented Jan 4, 2021

To enable wifi on phone run this:
adb shell svc wifi enable

@Dryzler
Copy link

Dryzler commented Apr 20, 2025

Hello,
what is the opposite command to deactivate usb tethering? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment