Skip to content

Instantly share code, notes, and snippets.

@zlocate
Created December 13, 2020 10:22
Show Gist options
  • Select an option

  • Save zlocate/d7980307997473595aa5eacd1a479f5e to your computer and use it in GitHub Desktop.

Select an option

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

zlocate commented Jan 4, 2021

Copy link
Copy Markdown
Author

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

@Dryzler

Dryzler commented Apr 20, 2025

Copy link
Copy Markdown

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