Is there any technique in java through which we can get into android device and turn on its USB debugging mode ON.
Asked
Active
Viewed 8,567 times
2 Answers
2
I hope not. It is obiviously an inherent security risk to enable and should thus only be enabled if you are really sure what you are doing (e.g. if you are a developer testing an app).

koljaTM
- 10,064
- 2
- 40
- 42
-
1But we can turn it ON through device's developer option. So, there must be some thing in java which will help us in doing similar thing through code. – Swapnil Walivkar Aug 21 '13 at 10:46
2
This is only available for system apps in respect of security. If your device is rooted you are able to call this:
Settings.Secure.putInt(getActivity().getContentResolver(),Settings.Secure.ADB_ENABLED, 1);

Steve Benett
- 12,843
- 7
- 59
- 79
-
Ok. But what if the device is not rooted. Is there any way to do this? Like after connecting device with pc the device should prompt a message saying turn on usb debugging mode on. – Swapnil Walivkar Aug 21 '13 at 10:38
-
As he said, only system apps can do this. For instance HTC Sense has own system apps for that. – David Olsson Aug 21 '13 at 11:03
-