别人学习网址:http://www.51testing.com/html/58/15092658-2984032.html

使用aapt    
aapt是sdk自带的一个工具,在sdk\builds-tools\目录下,

1. 在cmd中,切换至sdk\builds-tools\目录下,即aapt.exe目录下
2.以QQ音乐为例,命令行中切换到aapt.exe目录执行:aapt dump badging C:\Users\Administrator\Desktop\QQyinle_155.apk(apk所在目录位置)
3.运行后的结果中以下两行分别是应用包名package和入口activity名称
package: name='com.tencent.qqmusic'
launchable-activity: name='com.tencent.qqmusic.activity.AppStarterActivity'

 
以上方法本人亲自操作过,以下诸多方法借鉴其他人,mark一下:
 
方法一:
adb shell pm list package -f
将获取手机内所有apk对应的包名和路径
方法二:
adb shell dumpsys window w | findstr \/ | findstr name=
先打开需要查找的apk后,再敲入以上命令
 
方法三:
C:\Users\Administrator>adb shell
root@msm8916_32_512:/ # logcat | grep Android.intent.category.LAUNCHER
 
方法四:
adb shell dumpsys activity > d:\log.txt
先启动需要的查找的apk,再敲入以上命令,在stack #1下查找cmp=
方法五:
C:\Users\Administrator>adb shell
root@msm8916_32_512:/ # logcat | grep START
 

先启动需要查找的apk,再敲入以上命令,找到最后一个ActivityManager

 

方法六:
查看AndroidManifest.xml
1.使用apktool反编译app:apktool d QQyinle_155.apk E:\apk\QQYinyue
2.打开AndroidManifest.xml
manifest节点的package属性值是应用的包名:<manifest package=”com.estrongs.android.pop”>
查找android.intent.action.MAIN和android.intent.category.LAUNCHER对应的activity,该activity对应的android:name属性既是入口activity名称,
android.intent.action.MAIN决定应用程序最先启动的Activity
android.intent.category.LAUNCHER决定应用程序是否显示在程序列表里

monkey如何获取app包名的更多相关文章

  1. Appium+Python自动化 3 -获取 app 包名和 activity

    方法一: ①手机通过USB连接电脑 ②打开手机上被测app ③在电脑上 dos命令窗口,输入命令 adb shell dumpsys window w | findstr \/ | findstr n ...

  2. android 自动化压力测试-monkey 2 获取程序包名

    monkey 1 中我们写到: C:\Users\chenshan>adb shell shell@hwG750-T20:/ $ monkey -p cn.emoney.acg -v 500 说 ...

  3. android获取APP 包名和activity

    1.连接设备并启动被测试app应用 2.打开cmd窗口 3.windows获取包名和activity    adb shell dumpsys activity |find "mFocuse ...

  4. Android中通过pid获取app包名

    String callerPackage = getAppNameByPID(getContext(), Binder.getCallingPid()); private String getAppN ...

  5. Appium自动化测试3之获取apk包名和launcherActivity后续

    接着“Appium自动化测试3之获取apk包名和launcherActivity”章节介绍 测试脚本 1.测试脚本如下: # -*- coding:utf-8 -*- import os, time, ...

  6. Android获取APK包名的几种方法

    Android获取APK包名的几种方法:1.adb shell pm list package -f | findstr 关键字 #只能获取到包名,主Activity名无法获取到 2.使用aapt-- ...

  7. 如何获取当前包名与activitity&&抓log

    若hi1:获取当前包名以及Activity (1)adb shell dumpsys activity | find "mFocusedActivity" (2)adb shell ...

  8. 使用adb命令查看APP包名 和 包入口方法

    方法一: 1.查看 前台应用 包名,使用此命令注意:手机只启动要查看包名的app adb shell dumpsys activity | find "mFocusedActivity&qu ...

  9. Android自动化学习笔记:获取APK包名的几种方法

    ---------------------------------------------------------------------------------------------------- ...

随机推荐

  1. <Spark><Spark Streaming><作业分析><JobHistory>

    Intro 这篇是对一个Spark (Streaming)作业的log进行分析.用来加深对Spark application运行过程,优化空间的各种理解. Here to Start 从我这个初学者写 ...

  2. L322

    As a nutritionist helping people shed pounds, I often recommend incorporating portion-controlled des ...

  3. dos命令:批处理

    批处理 一.call命令 1.介绍 从批处理程序调用另一个批处理程序. 2.语法 CALL [drive:][path]filename [batch-parameters] batch-parame ...

  4. centos /data目录扩容

    /data盘被日志撑死了,必须扩容 有一块现成的100G的/dev/sdb盘,但是mount到了/data/test目录下,而且还有应用程序在上面进行读写操作 1.先查看哪些应用程序 在占用磁盘 #f ...

  5. 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext

    我使用的是5.2.8的hibernate的jar包,运行的时候却报错Could not open Hibernate Session for transaction; nested exception ...

  6. Codex Delphi Expert

    https://www.delphiworlds.com/codex/?tdsourcetag=s_pcqq_aiomsg Codex是什么? 是一个可以安装到Delphi IDE中的专家 有助于提高 ...

  7. Python基础3--Python复杂数据类型

    1 堆 堆是一种二叉树,其中每个父节点的值都小于或等于其所有子节点的值,最小的元素总是位于二叉树的根节点. 堆的创建 import heapq import random data = range(1 ...

  8. Quartz 原理

    Quartz API :http://www.quartz-scheduler.org/api/2.2.0/ http://www.boyunjian.com/javadoc/org.apache.s ...

  9. 大数据-04-Hbase入门

    本文主要来自于 http://dblab.xmu.edu.cn/blog/install-hbase/ 谢谢原作者 本指南介绍了HBase,并详细指引读者安装HBase. 前面第二章学习指南已经指导大 ...

  10. [LeetCode&Python] Problem 599. Minimum Index Sum of Two Lists

    Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite ...