I'm running Marshmallow on a Nexus 5, and I tether it to my laptop via USB. Is there a way to configure things so that the tethering happens automatically when I plug things in? (It's 5-6 touches to turn on the tethering.)

  • Just a side note - if you find an answer that works, make sure you remember what state tethering is (on/off) when you use it with any other computer ;) – Joe Nov 4 '15 at 13:58

The action Net → USB Tether of Tasker app as suggested by philx_x doesn't work in my CM13 for OnePlus One. The action is not supported so it appears disabled. The workaround is to use this action:

Code → Run Shell:

  • Command: service call connectivity 30 i32 1
  • tick Use Root

Use it with the profile: State → Power → Power → Source: USB

Note: your Android needs to be rooted.

Automate also worked in my ROM, albeit with root access. This is how the flow can look like:

(Click image to enlarge)


  • The second block is named Power source plugged?
  • The last block is named USB tethering set state.

Configure those blocks per your needs. Make sure you install the permission it asks for before you start the flow.


You can do this using the Interact block in Automate. Then it does not require root. Here is a flow to do just that. I first got the idea from a post by llamalab on androidforums.

Here are two explanatory screenshots from the Automate app:

Part of the flow The interact settings

You might have to modify the UI Element Class or UI Element Text to make it work with your phone.

  • Works for me without root. However, I still have to manually unlock the device. – lewurm Oct 10 '18 at 15:10

Try Tasker.

Enable USB Tethering when USB is plugged in into a PC:

  • Context: State –> USB Plugged
  • Action: Net –> USB Tether


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.