别人学习网址: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. shell脚本实例-批量检查多个网站地址是否正常

    #!/usr/bin/bash [ -f /etc/init.d/functions ] && . /etc/init.d/functions array=( http://www.w ...

  2. kbmMW SmartService控制返回类型

  3. python 常用的高阶函数

    前言 高阶函数指的是能接收函数作为参数的函数或类:python中有一些内置的高阶函数,在某些场合使用可以提高代码的效率. map() map函数可以把一个迭代对象转换成另一个可迭代对象,不过在pyth ...

  4. python 时间戳算法

    根据当前时间戳获得整小时时间戳 unit = 3600 start_time = int(time.time())/3600 * 3600 根据当前时间戳获得整天时间戳 unit = 3600*24 ...

  5. opendressinghash //use resize array

    public class opendressinghash<Key, Value> { private static final int INIT_CAPACITY = 4; privat ...

  6. linux下开启oracle服务和开启监听

    su - oracle  切换到oracle用户模式下 sqlplus /nolog  //登录sqlplus SQL> connect /as sysdba  //连接oracle SQL&g ...

  7. PAT 乙级1003. 我要通过!(20)

    “答案正确”是自动判题系统给出的最令人欢喜的回复.本题属于PAT的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”. 得到“答案正确”的条件是: 1 ...

  8. python基础4文件操作

    在磁盘上读取文件的 功能都是由操作系统来实现的,不允许普通的程序直接操作磁盘,所以读写文件就是请求操作系统打开一个文件对象(通常称为文件描述符),然后,通过操作系统提供的接口从这个文件对象中读取数据( ...

  9. spring boot项目,application.properties配置文件下中文乱码解决方案

    转自:https://blog.csdn.net/qq_40408534/article/details/79831807 如以上,application.properties文件下中文乱码.发生乱码 ...

  10. PRCT-1302 the OCR has an invalid ip address

    PRCT-1302 the OCR has an invalid ip address 1. 报错信息 an internal error occurred within cluster verifi ...