操作步骤
- 手机用数据线连上电脑,开启USB调试
- 运行你要拷贝的APK,并使用adb获取包名
# MAC || Linux
adb shell dumpsys activity | grep "top-activity"
# Window
adb shell dumpsys activity | find "top-activity"
- 获取包名位置
adb shell pm path com.apkfuns.demo
- 取出包名
adb pull /data/app/com.apkfuns.demo-1.apk <桌面上路径>
注意事项
如果apk是直接运行进去手机的,直接安装会报错:
Failure [INSTALLFAILEDTEST_ONLY: installPackageLI]
- 方法1:
adb push *.apk /tmp
adb shell pm install -t /tmp/*.apk
- 方法2:
adb install -t *.apk