I hope this isn't as niche as it looks. In Android 6 apparently there's no way to disable mobile data using Tasker alone. So, I'm trying to disable mobile data via Secure Settings, using the "mobile data" setting. It gives out an error when the task runs. I have given both Tasker and Secure Settings pretty much all permissions I could find in settings. Still no go. Ideas?

2 Answers 2


Unfortunately, Secure Settings doesn't work well on Android Marshmallow due to lack of platform compatible updates. That been said, you can toggle mobile data using command-line approach in Tasker.

Action: Code → Run Shell:

  • Command: svc data disable

    Replace disable with enable to enable mobile data.

  • tick Use Root.

Tasker community at Reddit has compiled a useful list of all the Secure Settings actions' command-line alternatives. You can find the list here.

An alternative to command-line based approach is to use an another automation app in parallel or with Tasker, such as MacroDroid and Automate. Both the apps can toggle mobile data, given root access is granted to them.

  • Cool! Thank you so much. I suppose those automation apps also require me to disable the "screen jacking" protections, since they simulate user actions? I wonder when Android is going to break that as well :(. So far I've been quite disappointed with my Android upgrade experience. I eventually reverted to my old 4.4 ROM because there's simply too much missing. They managed to screw up even the simple battery display graph, which now doesn't show time since last charge, you need to install a custom app for that. sigh...
    – Axonn
    Sep 30, 2016 at 8:58

I use Toggle Data 5.0 on CM13 (third party distribution for the Samsung S4, ResurrectionRemix). XDA Developers link. It works well.

You must log in to answer this question.

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