Is it possible to enable USB debugging (under settings/applications/development) programmatically from within my app?
I was looking at Permission.WRITE_SETTING
You can enable adb programmatically by requesting WRITE_SECURE_SETTINGS in manifest and granting it over adb shell:
adb shell pm grant your.package.name android.permission.WRITE_SECURE_SETTINGS
Then you can enable adb on API 17 and above by calling:
Settings.Global.putString(mContext.getContentResolver, Settings.Global.ADB_ENABLED,"1");
For API 16 to API 3 call:
Settings.Secure.putString(mContext.getContentResolver, Settings.Secure.ADB_ENABLED,"1");
To disable adb replace "1" with "0" in commands