Search code examples
javaandroidandroid-context

Any way to go directly to the "Enable Usb Debugging" page in Android?


Is there an Intent that goes directly to the "Enable USB Debugging" toggle or a way to request it to be enabled?

---Situation Explanation---

We have an application we use for testing on many phones at once and they all have developer mode enabled. However, usb debugging needs to be enabled when they're all reflashed.

We're aware of how to do this via ADB but our use case requires using a traditional in Android approach.

--- End Explanation

Is it possible to open a dialog allowing the user to go directly to the Usb Debugging option?

Similarly, is it possible to do this with developer mode?


Solution

  • No, it is not possible I'm afraid.

    Here is a list of all Settings that can be opened with an Intent, note that USB debugging is not among them.

    The closest you can get is opening up development settings (as the 2nd half of your question asked) with ACTION_APPLICATION_DEVELOPMENT_SETTINGS (more info), which does the following:

    Activity Action: Show settings to allow configuration of application development-related settings.