相关命令 查看当前连接设备 1 adb devices 如果发现多个设备 1 adb -s 设备号 其他指令 安装命令 1 adb install path ame.apk 覆盖安装 1 adb install path am
1 adb devices
1 adb -s 设备号 其他指令
1 adb install path
ame.apk
1 adb install path
ame.apk
1.查看apk主包名
知道apk包名,反编译操作
1 D:>aapt dump badging jisuanqi_587.apk
2 package: name=‘com.ibox.calculators‘ versionCode=‘587‘ versionName=‘2.8.7‘ platfORMBuildVersionName=‘6.0-2704002‘
3 sdkVersion:‘14‘
4 targetSdkVersion:‘19‘
不知道apk报名,打开模拟器中的app
1 D:>adb shell dumpsys window | findstr mCurrentFocus
2 mCurrentFocus=Window{e66be70 u0 com.ibox.calculators/com.ibox.calculators.CalculatorActivity}
2.卸载操作
1 D:>adb uninstall com.ibox.calculators
2 Success
1 D:>adb shell
2 vbox86p:/ #
首先需要知道俩个,1.windos下文件的路径及文件名称,2.上传至手机模拟器上的路径
1 adb shell find / -name 文件夹名称 -type d
开始上传
1 D:>adb push file_test.txt /data/media/0/Download
2 file_test.txt: 1 file pushed, 0 skipped. 0.0 MB/s (13 bytes in 0.002s)
注: file_test.txt 为当前D:下的文档,/data/media/0/Download 为手机路径
1 D:>adb pull /data/media/0/Download/test/file_test.txt File
2 /data/media/0/Download/test/file_test.txt: 1 file pulled, 0 skipped. 0.0 MB/s (13 bytes in 0.001s)
注: /data/media/0/Download/test/file_test.txt 为手机路径, File 为电脑路径
1 adb shell dumpsys package com.ibox.calculators
1 C:UsersAlin>adb shell pm path com.ibox.calculators
2 package:/data/app/com.ibox.calculators-JFzmL_qeOWqldw_nuBAG2A==/base.apk
先根据adb shell dumpsys window | findstr mCurrentFocus查找到
C:UsersAlin>adb shell am start -n com.ibox.calculators/com.ibox.calculators.CalculatorActivity
Starting: Intent { cmp=com.ibox.calculators/.CalculatorActivity }
1 C:UsersAlin>adb shell pm clear com.ibox.calculators
2 Success
1 C:UsersAlin>adb shell ps|findstr com.ibox.calculators
2 u0_a102 3988 282 984300 106688 ep_poll f15f4bb9 S com.ibox.calculators:ghosty
3 u0_a102 4020 282 998936 107988 ep_poll f15f4bb9 S com.ibox.calculators:pushservice
4 u0_a102 4030 1 985296 22240 unix_stream_read_generic f15f4bb9 S com.ibox.calculators:ghosty
5 u0_a102 4059 282 1171828 215852 ep_poll f15f4bb9 S com.ibox.calculators
1 C:UsersAlin>adb shell kill 5213
1 C:UsersAlin>adb shell dumpsys meminfo com.ibox.calculators
1 adb shell input keyevent KEYCODE_BACK
相关命令可查看这个博客:https://www.cnblogs.com/bluestorm/p/4886662.html
adb loGCat [选项] [过滤项] (选项过滤项可填可不填)
-s:设置输出日志的标签, 只显示该标签的日志;
1 C:UsersAlin>adb logcat -s PackageManager
2 --------- beginning of main
3 --------- beginning of system
4 07-28 10:26:00.282 1091 1481 W PackageManager: Failure retrieving resources for com.ibox.calculators
-f:将日志输出到文件,该文件是在手机上的路径+文件名
1 C:UsersAlin>adb logcat -f /data/media/0/Download/test.log
-c:清空所有日志的缓存信息
1 C:UsersAlin>adb logcat -c
-v:
1 C:UsersAlin>adb logcat *:W
1 C:UsersAlin>adb logcat -s System:E
2 --------- beginning of main
3 --------- beginning of system
4 07-28 10:37:40.043 6232 6410 E System : ******** DEPRECATED FUNCTIONALITY ********
5 07-28 10:37:40.043 6232 6410 E System : * The implementation of the KeyFactory.RSA alGorithm from
6 07-28 10:37:40.043 6232 6410 E System : * the BC provider is deprecated in this version of Android.
7 07-28 10:37:40.043 6232 6410 E System : * It will be removed in a future version of Android and your
8 07-28 10:37:40.043 6232 6410 E System : * application will no longer be able to request it. Please see
9 07-28 10:37:40.043 6232 6410 E System : * Https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html
10 07-28 10:37:40.043 6232 6410 E System : * for more details.
11 07-28 10:39:22.948 6232 6427 E System : ******** DEPRECATED FUNCTIONALITY ********
12 07-28 10:39:22.948 6232 6427 E System : * The implementation of the KeyFactory.RSA algorithm from
13 07-28 10:39:22.948 6232 6427 E System : * the BC provider is deprecated in this version of Android.
14 07-28 10:39:22.948 6232 6427 E System : * It will be removed in a future version of Android and your
15 07-28 10:39:22.948 6232 6427 E System : * application will no longer be able to request it. Please see
16 07-28 10:39:22.948 6232 6427 E System : * https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html
17 07-28 10:39:22.948 6232 6427 E System : * for more details.
adb命令使用
原文地址:https://www.cnblogs.com/ClownAlin/p/13393104.html
--结束END--
本文标题: adb命令使用
本文链接: https://www.lsjlt.com/news/7570.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0