I can run the following command to enable USB tethering when my device is connected

adb shell service call connectivity 33 i32 1 s16 text

and to disable it

adb shell service call connectivity 33 i32 0 s16 text

I have tested both of these commands and they are working.

I want to execute the first command whenever my device is connected to my pc. I know it can be done using something called a udev rule but I don't know how.

1 Answer 1


UDEV rules that run a specific script when a USB device is attached or removed can be achieved by defining the rules under /etc/udev/rules.d.

This article should be helpful to you:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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