Skip to content

Commit 5d95eba

Browse files
committed
update
1 parent e2c1963 commit 5d95eba

File tree

2 files changed

+104
-1
lines changed

2 files changed

+104
-1
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: "ADB命令汇总"
3+
categories:
4+
- android
5+
tags:
6+
- Android
7+
- adb
8+
toc: true
9+
---
10+
11+
ADB(Android Debug Bridge)是Android SDK中的一个命令行工具,用于与Android设备进行通信和调试。以下是一些常用的ADB命令汇总。
12+
13+
```shell
14+
ps --help
15+
ps -o help # 查看输出的字段说明
16+
17+
# 查看system_server进程的PID
18+
ps -ef | grep system_server # 方法一
19+
pidof system_server # 方法二
20+
21+
# 查看某进程的UID
22+
ps -ef | grep system_server
23+
cat /proc/<pid>下的内容
24+
25+
# 查看某进程的UID中的某个线程的信息
26+
ps -T -p 3254 | grep Fingerprint
27+
28+
# 查看某个进程的adj值
29+
cat /proc/<pid>/oom_score_adj
30+
31+
# 查看某个进程是否被冷冻
32+
ps -A | grep system_server 看是否处于do_freezer_trap状态
33+
34+
adb shell dumpsys SurfaceFlinger | grep -i "Display 0 HWC layers"
35+
36+
adb shell cmd window tracing level all
37+
adb shell dumpsys window debugConfiguration
38+
adb shell cmd window tracing start|stop
39+
40+
adb exec-out dumpsys window --proto > window_dump.pb
41+
42+
adb shell service call SurfaceFlinger 1025 i32 1
43+
adb shell service call SurfaceFlinger 1025 i32 0
44+
45+
46+
adb shell pm list packages
47+
adb shell pm path pkgName
48+
adb shell pm disable pkgName
49+
50+
51+
dumpsys package pkgName | gre userId
52+
53+
dumpsys package pkgName | grep targetSdk
54+
55+
adb shell setprop persist.log.tag M
56+
57+
adb shell cat dev/kmsg # 实时kmsg日志
58+
59+
adb shell logcat -G 16M
60+
adb shell logcat -v threadtime -c
61+
62+
adb shell "mount -o remount,rw /system"
63+
adb remount
64+
65+
adb shell dumspys battery set level 8
66+
67+
adb unistall pkgName
68+
adb shell "dd if=/dev/zero of=/data/local/tmp/test.txt bs=1M count=10"
69+
70+
adb shell setprop persist.sys.dalvik.vm.lib.2 art
71+
adb shell getprop persist.sys.dalvik.vm.lib.2
72+
73+
adb shell settings put global window_animation_scale 0.0
74+
adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS
75+
76+
adb shell svc power stayon true
77+
78+
adb shell ime list -s
79+
adb shell settings get secure default_input_method
80+
81+
82+
adb shell wm logging enable-text WM_DEBUG_KEEP_SCREEN_ON
83+
84+
85+
git log -S fitsSystemWindows --pretty=oneline --since=2024-01-01 --until=2024-12-31 author:jiangxin
86+
87+
repo forall -p -c "git log -S fitsSystemWindows --pretty=oneline --since=2024-01-01 --until=2024-12-31 author:jiangxin"
88+
89+
```

_posts/the-way-of-learning/2015-05-19-Android学习之路.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Android开发者网站包含了以下内容:
100100
* Android Recovery升级原理: <https://www.cnblogs.com/linhaostudy/p/11543687.html>
101101
* [Android 基础] -- Android 属性系统简介: <https://blog.csdn.net/u014674293/article/details/119147063>
102102
* 实现 Java SDK 库: <https://source.android.google.cn/docs/setup/build/java-library>
103+
* 了解日志记录: <https://source.android.com/docs/core/tests/debug/understanding-logging>
103104

104105
### NDK
105106

@@ -178,6 +179,7 @@ Android开发者网站包含了以下内容:
178179
* Multi-Touch Input Parser: <https://github.com/hisdar/input_log_parser>
179180
* Android Input概念(getevent -ltr): <https://juejin.cn/post/7294147620914036786>
180181
* Android的触控重采样算法: <https://blog.csdn.net/marshal_zsx/article/details/105902296>
182+
* Android Systrace 基础知识 - Input 解读: <https://androidperformance.com/2019/11/04/Android-Systrace-Input/>
181183

182184
### 组合键
183185

@@ -224,6 +226,7 @@ Android开发者网站包含了以下内容:
224226
* Android Accessibility – Making your app Switch Access Compatible: <https://riggaroo.dev/android-accessibility-switch-access/>
225227
* 让应用使用起来更没有障碍: <https://developer.android.google.cn/guide/topics/ui/accessibility/apps>
226228
* 使用 Jetpack Compose 改进应用的无障碍功能: <https://developer.android.com/develop/ui/compose/accessibility>
229+
* Android 无障碍服务导致的整机卡顿案例分析: <https://androidperformance.com/2019/01/21/android-performance-case-jank-accessbility/>
227230

228231
### 电源管理
229232

@@ -239,13 +242,16 @@ Android开发者网站包含了以下内容:
239242
* 揭秘Android系统:掌握sys.powerctl,轻松提升设备续航与性能: <https://www.oryoy.com/news/jie-mi-android-xi-tong-zhang-wo-sys-powerctl-qing-song-ti-sheng-she-bei-xu-hang-yu-xing-neng.html>
240243
* Soft restarts (<= AOSP 14): <https://source.android.google.cn/docs/core/runtime/soft-restart?hl=en>
241244
* Android R PowerManagerService模块(2) WakeLock机制: <https://juejin.cn/post/6947092185930350622>
245+
* Extra Dim in Android 12: <https://gadgetguideonline.com/android/extra-dim-in-android-12-the-definite-guide/>
246+
* Resume-on-Reboot: <https://source.android.com/docs/core/ota/resume-on-reboot>
242247

243248
### 开机动画
244249

245250
* Android 12 开机动画代码与流程详解: <https://blog.csdn.net/qq_43625390/article/details/124691462>
246251

247252
### 生物识别
248253

254+
* 生物识别: <https://source.android.com/docs/security/features/biometric>
249255
* Android8.0 Fingerprint指纹启动流程详细分析: <https://blog.csdn.net/weixin_43943188/article/details/88321101>
250256
* FingerPrintAuth: <https://github.com/hetaoyuan-android/FingerPrintAuth/blob/9d9b82ea2ab6b717dec1f0f1d11e0e7d2251f586/app/src/main/java/com/feelschaotic/MainActivity.java>
251257

@@ -437,6 +443,8 @@ Android开发者网站包含了以下内容:
437443
* Carson带你学Android:自定义View Canvas类使用教程: <https://blog.csdn.net/carson_ho/article/details/60598775>
438444
* Android中Canvas绘图之PorterDuffXfermode使用及工作原理详解: <https://blog.csdn.net/iispring/article/details/50472485>
439445
* HenCoder——给高级 Android 工程师的进阶手册: <https://hencoder.com/>
446+
* Change the value of an app's resources at runtime: <https://source.android.com/docs/core/runtime/rros>
447+
* 处理多点触控手势: <https://developer.android.com/develop/ui/views/touch-and-input/gestures/multi>
440448

441449
### Statsd
442450

@@ -473,6 +481,7 @@ Android开发者网站包含了以下内容:
473481
### Sensor
474482

475483
* Android 4.4 Kitkat Phone工作流程浅析(十一)__PSensor工作流程浅析: <https://blog.csdn.net/yihongyuelan/article/details/43449851>
484+
* SensorPrivacyManager
476485

477486
### Vibrator
478487

@@ -507,6 +516,7 @@ Android开发者网站包含了以下内容:
507516
* Lockdown: <https://www.51cto.com/article/581516.html>
508517
* Android FRP功能分析(Factory Reset Protection): <https://mabin004.github.io/2018/07/25/Android-FRP%E5%8A%9F%E8%83%BD%E5%88%86%E6%9E%90%EF%BC%88Factory-Reset-Protection%EF%BC%89/>
509518
* Android 中的安全增强型 Linux: <https://source.android.google.cn/docs/security/features/selinux?hl=zh-cn>
519+
* Private space: <https://source.android.com/docs/security/features/private-space>
510520

511521
### 硬件
512522

@@ -519,6 +529,11 @@ Android开发者网站包含了以下内容:
519529
* casa-android: <https://github.com/google/casa-android>
520530
* Now in Android App: <https://github.com/android/nowinandroid>
521531

532+
## CTS
533+
534+
* Android兼容性测试CTS Verifier-环境搭建、测试执行、结果分析: <https://www.cnblogs.com/wi100sh/p/4613502.html>
535+
* 兼容性测试套件 (CTS) 概览: <https://source.android.com/docs/compatibility/cts>
536+
522537
## Article
523538

524539
* Google is preparing to let you run Linux apps on Android, just like Chrome OS: <https://www.androidauthority.com/android-linux-terminal-app-3489887/>
@@ -614,7 +629,6 @@ Android开发者网站包含了以下内容:
614629
* Android中app进程ABI确定过程: <https://blog.csdn.net/weixin_40107510/article/details/78138874>
615630
* Context, What Context? <https://possiblemobile.com/2013/06/context/>
616631
* INSTALL_FAILED_TEST_ONLY: <https://blog.csdn.net/zou_pl/article/details/78679394>
617-
* Android兼容性测试CTS Verifier-环境搭建、测试执行、结果分析: <https://www.cnblogs.com/wi100sh/p/4613502.html>
618632
* Why do most fields (class members) in Android tutorial start with `m`? <https://stackoverflow.com/questions/2092098/why-do-most-fields-class-members-in-android-tutorial-start-with-m>
619633
* Android多语言国际化适配(兼容7.0): <https://blog.csdn.net/pigdreams/article/details/81277110>
620634
* android程序自动化生成apk的过程: <https://blog.csdn.net/f2006116/article/details/52254519>

0 commit comments

Comments
 (0)