Is it possible to enable USB debugging (under settings/applications/development) programmatically from within my app?
I was looking at Permission.WRITE_SETTING
If your device has root, and API level > 17 for enable adb:
Runtime.getRuntime().exec(new String[] {"su", "-c", "settings put global adb_enabled 1"});
or (depends of su implementation)
Runtime.getRuntime().exec(new String[] {"su", "settings put global adb_enabled 1"});
For disable - change last argument from 1 to 0