renyuneyun / Easer

User-defined explicit automation for Android
https://renyuneyun.github.io/Easer/
GNU General Public License v3.0
789 stars 90 forks source link

Add Operation "USB Tethering" #40

Open krickler opened 6 years ago

krickler commented 6 years ago

I use my old smartphone as a lte modem, so an option to toggle USB tethering would be nice.

renyuneyun commented 6 years ago

I did a brief search and find out that there is no uniform way to enable/disable USB tethering...

The methods I found are based on "mimicing user operation" (keyboard events actually), which depends on the location of the USB tethering selection (e.g. the 5th selection on the "system settings" page, then the 3rd selection on the next page, then the 1st selection). However, this location differs from device to device... So, currently there seems to be no other way...

pilot4u commented 3 years ago

Is it possible to use this command just without the adb shell prefix?

adb shell su -c service call connectivity 34 i32 1

https://stackoverflow.com/q/20226924/7551330