2

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

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:

https://www.thegeekdiary.com/how-to-run-a-script-when-usb-devices-is-attached-or-removed-using-udev/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .