다음 요구 사항을 충족하는 Android 애플리케이션을 개발하려고합니다. 어떤 방법으로 코드를 통해, 나는 디버그 모드에서 장치에 설치된 애플 리케이션의 목록을 얻을 수 있습니다.Android - 디버그 모드에서 앱 목록 가져 오기
미리 감사드립니다.
EDIT - 다음 코드를 시도했습니다. 이 응용 프로그램을 킥오프하기 위해 당신에게 충분한 정보를 제공해야
Intent main = new Intent(Intent.ACTION_MAIN, null);
main.addCategory(Intent.CATEGORY_LAUNCHER);
List pkgAppsList = context.getPackageManager().queryIntentActivities(main, 0);
다음
PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (int i=0; i < packages.size(); i++)
{
if ((packages.get(i).flags & ApplicationInfo.FLAG_SYSTEM) == 1)
{
//This is for System applications
}
else
{
boolean isDebuggable = (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE));
if((pm.getLaunchIntentForPackage(packages.get(i).packageName)!=null) && (isDebuggable = true))
{
// Only For Apps with debug mode set true, this line should get executed
// But this does not happens
}
}
}
"디버그 모드"로 정의하십시오. – CommonsWare
android manifest xml에서 android debuggable 속성이 true로 설정된 경우 해당 앱이 Android 디버그 모드로 설정됩니다. – Prem