Reputation: 4694
Is it possible to have an application detect when ADB is listening over USB on an Android phone?
I'm looking for something like this: Is it possible to determine whether an Android device is plugged into a computer or just power? but specifically for when ADB is running.
Thanks!
Upvotes: 9
Views: 4484
Reputation: 65
Settings.Global.getInt(context.getContentResolver(), Settings.Global.ADB_ENABLED, 0);
Will return a 1 if USB Debugging is enabled on the phone and a 0 if it isn't.
Upvotes: 4