Take the 2-minute tour ×
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
    
That's really cool. I tried to find other commands doing aapt dump xmltree com.android.settings.apk AndroidManifest.xml but that didn't work on my phone(aapt not found). How can I see a list of the available settings ? –  George Profenza Jul 5 '13 at 15:24
    
elinux.org/Android_aapt –  sputnick Jul 5 '13 at 15:37
    
Thanks! I've found aapt in the build-tools folder. I can run it now. I can't seem to find com.android.settings.apk though. I've tried: find / -name 'com.android.settings.apk' on the phone, but nothing came up :( Can you please let me know where I can find com.android.settings.apk ? –  George Profenza Jul 5 '13 at 15:50

2 Answers 2

Try the setprop command below:

setprop sys.usb.config rndis,adb

share|improve this answer
    
This is only part of what's needed. This won't start dnsmasq for instance. –  kroot Dec 3 '13 at 6:25

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

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.