获取手机中安装应用的apk

  1. 查看apk的包名
$ adb shell pm list packages
package:com.google.android.carriersetup
package:com.android.cts.priv.ctsshim
package:com.google.android.youtube
package:com.luojilab.androidcomponent
package:com.google.android.ext.services
package:com.android.providers.telephony
package:com.android.sdm.plugins.connmo
package:com.google.android.googlequicksearchbox
package:com.android.providers.calendar
package:com.android.providers.media
package:com.huawei.entitlement
package:com.alibaba.android.arouter.demo
...
package:com.qualcomm.timeservice
package:com.qualcomm.atfwd
package:com.android.providers.contacts
package:com.android.captiveportallogin
package:com.google.android.GoogleCamera
package:com.android.connectivity.metrics
package:com.google.android.inputmethod.latin
package:com.google.android.storagemanager
  1. 获取apk路径
$ adb shell pm path com.tencent.mobileqq
package:/data/app/com.tencent.mobileqq-64MOEtFb_G6bFBkkG5_cpQ==/base.apk
  1. 导出APK
$ adb pull /data/app/com.tencent.mobileqq-64MOEtFb_G6bFBkkG5_cpQ==/base.apk ~/Documents/apks/   
/data/app/com.tencent.mobileqq-64MOEtFb_G6bFBkkG5_cpQ==/base.apk: 1 file pulled. 25.7 MB/s (68983530 bytes in 2.564s)

导出目录需要提前创建好
执行没有错误就可以到~/Documents/apks/ 目录下找到刚刚导出到apk了

  1. 获取APK后,就可以查看apk的相关信息了。 简单点就直接把apk丢到Studio中就可以看数据信息了,当然还可以使用命令行查看。
$ adb shell pm dump  com.tencent.mobileqq | grep "versioName"
versionName=8.0.0

你可能感兴趣的:(获取手机中安装应用的apk)