Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically turn ON usb debugging mode of Android device using java

Tags:

java

android

usb

Is there any technique in java through which we can get into android device and turn on its USB debugging mode ON.

like image 284
Swapnil Walivkar Avatar asked Jun 22 '26 20:06

Swapnil Walivkar


2 Answers

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).

like image 56
koljaTM Avatar answered Jun 24 '26 09:06

koljaTM


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);
like image 21
Steve Benett Avatar answered Jun 24 '26 11:06

Steve Benett



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!