如何识别启动活动名称?

时间:2016-07-26 12:40:20

标签: android github keyboard appium

我通过appium或APK信息应用看到了app活动名称,但仍然令人困惑。 没有确定正确的活动名称。 请分享您的观点。

2 个答案:

答案 0 :(得分:0)

使用此代码获取每个应用的启动器活动

final PackageManager pm = getPackageManager();

        Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
        mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);

        List<ResolveInfo> appList = pm.queryIntentActivities(mainIntent, 0);
        Collections.sort(appList, new ResolveInfo.DisplayNameComparator(pm));

        for (ResolveInfo temp : appList) {

            Log.v("my logs", "package and activity name = "
                    + temp.activityInfo.packageName + "    "
                    + temp.activityInfo.name);


        }

答案 1 :(得分:0)

使用./aapt dum badging apkfilelocation Exp:输入“./aapt dum badging ../../../../../Desktop/Consumer.apk”