Skip to content

Instantly share code, notes, and snippets.

@omegasoft7
Created January 12, 2015 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omegasoft7/d2e3b448e00d12555b9e to your computer and use it in GitHub Desktop.
Save omegasoft7/d2e3b448e00d12555b9e to your computer and use it in GitHub Desktop.
Check if the app is debuggable
/**
* Returns true if the application is debuggable.
*
* @return true if the application is debuggable.
*/
static boolean isDebuggable() {
PackageManager pm = mApplication.getPackageManager();
try {
return ((pm.getApplicationInfo(mApplication.getPackageName(), 0).flags & ApplicationInfo.FLAG_DEBUGGABLE) > 0);
} catch (NameNotFoundException e) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment