以下方法可打印APP信息,用作debug
Set debuggableApps =newHashSet();
List apps = getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA);
for(ApplicationInfo app : apps) {
String appName = app.packageName;
if((app.flags& ApplicationInfo.FLAG_DEBUGGABLE) == ApplicationInfo.FLAG_DEBUGGABLE) {
debuggableApps.add(appName);
System.out.println("---------this is debuggable app------ ");
System.out.println(app.sourceDir);
System.out.println(appName);
}
}