如何找出未安装apk的名称包?

How to find out name package not installed apk?

如何找出没有安装apk的名称包?

Runtime.getRuntime().exec(new String[]{"su", "-c","aapt dump badging /sdcard/Downloads/ASD.apk grep package:\ name ->"+"/sdcard/asd"}).waitFor();

不工作。 找不到 aapt;

您可以使用 PackageManager:

    PackageInfo info = context.getPackageManager().getPackageArchiveInfo(apkFileName, 0);
    ApplicationInfo appinfo = info.applicationInfo;
    final String packageName = context.getPackageManager().getApplicationLabel(appinfo).toString();