adb shell命令

查看当前设备所有进程
adb shell ps


adb shell am start -n com.tele.life.iptv/com.v.android.itv.ui.itv.Activity
adb shell am start -n com.android.smart.terminal.myapplication/.MainActivity


adb保留数据卸载app
adb shell pm uninstall -k 包名

启动应用
adb shell am -n com.test/com.test.ui.WelcomeActivity

查看Activity堆栈情况
adb shell "dumpsys activity grep com.test"

日志打印输出
adb logcat -c
adb logcat -s Tag:D

查询进程uid
adb shell "dumpsys package com.vrv.im | grep userId="

获取应用程序的进程ID。可以通过运行以下命令获取:
adb shell "ps | grep your_package_name"

如需确定应用是否已被用户永久拒绝授予权限(用于调试和测试),请使用以下命令:
adb shell dumpsys package PACKAGE_NAME
列如:
runtime permissions:
 android.permission.POST_NOTIFICATIONS: granted=false, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
 android.permission.ACCESS_FINE_LOCATION: granted=false, flags=[ USER_SET|USER_FIXED|USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
 android.permission.BLUETOOTH_CONNECT: granted=false, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
被用户拒绝过一次的权限由 USER_SET 标记。由于用户选择了两次拒绝而被永久拒绝的权限由 USER_FIXED 标记。


ctrl +c 退出

杀掉占用的端口
taskkill /pid 5596 /f

创维开启adb方式

1.开启工厂模式
创维 设置-关于本机-本机信息 --(上上,下下,左右,左右)
2.在[通用]设置里面打开adb

抓取全量日志:
adb logcat  > logcat.txt
adb logcat -c
Ctrl+c    结束日志抓取

adb shell   抓取日志
C:\Users\Administrator>adb shell
mt9950_cn_sws:/ $ cd /sdcard/
mt9950_cn_sws:/sdcard $ ls -al
total 4580
-rw-rw----  1 root sdcard_rw 4557234 2015-01-01 21:35 logcat.log
drwxrwx--x  6 root sdcard_rw    4096 2024-07-30 10:55 qcache
mt9950_cn_sws:/sdcard $ exit
C:\Users\Administrator>adb pull /sdcard/logcat.log .
/sdcard/logcat.log: 1 file pulled, 0 skipped. 10.1 MB/s (4557234 bytes in 0.431s)
C:\Users\Administrator>cd C:\Users\Administrator\Desktop\debug
C:\Users\Administrator\Desktop\debug>adb pull /sdcard/logcat.log .
/sdcard/logcat.log: 1 file pulled, 0 skipped. 9.9 MB/s (4557234 bytes in 0.440s)


无线连接设备:
adb connect ip
adb disconnect ip

抓日志
adb logcat -c
adb shell
logcat -d > /sdcard/logcat.log
exit 
cd C:\Users\Administrator\Desktop\debug
adb pull /sdcard/logcat.log .












最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容