Tell me more ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I would like to activate "USB tethering" from within a bash script, so is there any possibility to run a command line with adb shell to change some Android settings ?

Edit1:

The following command open the needed settings but don't change anything alone :

am start -n com.android.settings/.TetherSettings

I've found TetherSettings action name from

aapt dump xmltree com.android.settings.apk AndroidManifest.xml | less +/ether
share|improve this question

2 Answers

There is a pretty bad method using adb shell input tap, Get the coordinates for enable tethering and substitute

adb shell input tap

Or navigate to enable radio using adb shell input keyevent. Just have a look at,

adb shell input

Again this confines to a particular device.

share|improve this answer

Try the setprop command below:

setprop sys.usb.config rndis,adb

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.