查看App的launcher属性是那个activity
adb shell
logcat | grep "START u0"
或者
adb shell dumpsys activity activities 查看当前的ResumedActivity
抓取开机log
adb wait-for-device && adb logcat > .\Desktop\log.log
搜索并查看有关phone的应用及所在位置
adb shell pm list package -f phone
package:/system/priv-app/MtkTeleService/MtkTeleService.apk=com.android.phone
列举安装的所有3方应用
adb shell pm list package -3
测试屏幕亮度
adb shell settings put system screen_brightness 100
获取手机的setting provider值
adb shell settings
Settings provider (settings) commands:
help
Print this help text.
get [--user <USER_ID> | current] NAMESPACE KEY
Retrieve the current value of KEY.
put [--user <USER_ID> | current] NAMESPACE KEY VALUE [TAG] [default]
Change the contents of KEY to VALUE.
TAG to associate with the setting.
{default} to set as the default, case-insensitive only for global/secure namespace
delete [--user <USER_ID> | current] NAMESPACE KEY
Delete the entry for KEY.
reset [--user <USER_ID> | current] NAMESPACE {PACKAGE_NAME | RESET_MODE}
Reset the global/secure table for a package with mode.
RESET_MODE is one of {untrusted_defaults, untrusted_clear, trusted_defaults}, case-insensitive
list [--user <USER_ID> | current] NAMESPACE
Print all defined keys.
NAMESPACE is one of {system, secure, global}, case-insensitive
比如列举所有secure的值,这里面有默认的输入法,默认屏保等
adb shell settings list secure
accessibility_display_inversion_enabled=null
clock_seconds=null
default_input_method=com.google.android.inputmethod.pinyin/.PinyinIME
double_tap_to_wake=1
doze_pulse_on_double_tap=null
doze_tap_gesture=null
enabled_input_methods=com.google.android.inputmethod.pinyin/.PinyinIME
enabled_notification_assistant=android.ext.services/android.ext.services.notification.Assistant
enabled_notification_listeners=com.android.launcher3/com.android.launcher3.notification.NotificationListener
enabled_notification_policy_access_packages=com.android.camera2
immersive_mode_confirmations=
input_methods_subtype_history=com.android.inputmethod.latin/.LatinIME;-1:com.google.android.inputmethod.pinyin/.PinyinIME;-1
notification_dismiss_rtl=null
qs_show_brightness=null
screensaver_activate_on_dock=1
screensaver_activate_on_sleep=0
screensaver_components=com.google.android.deskclock/com.android.deskclock.Screensaver
screensaver_default_component=com.google.android.deskclock/com.android.deskclock.Screensaver
sysui_qs_tiles=wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast
sysui_tuner_version=4
获取手机所有的prop值
adb shell getprop
启动activity
adb shell am start pkgname/activityname
切换手机电池为非充电状态(2是充电状态)
adb shell dumpsys battery set status 1
让手机电量显示百分百:
adb shell dumpsys battery set level 100
获取屏幕分辨率
adb shell wm size
强制设置分辨率 (可用于测试不同分辨率的显示)
adb shell wm size 1080x1920
设备显示密度
设置为480
adb shell wm density 480
查看
adb shell wm density
亮屏的指令,灭屏也是这个
adb shell input keyevent 26
截图
adb shell screencap -p /sdcard/1.png
抓log,debug级别的
adb logcat -d > d:/log.txt
重启
adb reboot
重启adb服务
adb kill-server
adb start-server
替换系统apk
adb root
restarting adbd as root
adb remount
remount successful
adb push out\target\product\xxx\system\system_ext\priv-app\SearchLauncherQuickStep\SearchLauncherQuickStep.apk /system/system_ext/priv-app/SearchLauncherQuickStep
查找进程并杀死
adb shell
SMARTWAY_X3:/ $ ps -ef|grep settings
system 4328 494 0 06:27:48 ? 00:00:13 com.android.settings
shell 9269 9266 1 09:40:52 pts/27 00:00:00 grep settings
SMARTWAY_X3:/ $ kill 4328
查看指定包名apk的路径
adb shell
SMARTWAY_X3:/ $ pm path com.android.launcher3
package:/system/system_ext/priv-app/SearchLauncherQuickStep/SearchLauncherQuickStep.apk
根据关键字段查看apk路径
adb shell pm list package -f settings
package:/product/priv-app/SettingsIntelligence/SettingsIntelligence.apk=com.android.settings.intelligence
package:/system/priv-app/MtkSettingsProvider/MtkSettingsProvider.apk=com.android.providers.settings
package:/system/system_ext/priv-app/MtkSettings/MtkSettings.apk=com.android.settings
查看系统的setting provider值
adb shell settings
Settings provider (settings) commands:
help
Print this help text.
get [--user <USER_ID> | current] NAMESPACE KEY
Retrieve the current value of KEY.
put [--user <USER_ID> | current] NAMESPACE KEY VALUE [TAG] [default]
Change the contents of KEY to VALUE.
TAG to associate with the setting.
{default} to set as the default, case-insensitive only for global/secure namespace
delete [--user <USER_ID> | current] NAMESPACE KEY
Delete the entry for KEY.
reset [--user <USER_ID> | current] NAMESPACE {PACKAGE_NAME | RESET_MODE}
Reset the global/secure table for a package with mode.
RESET_MODE is one of {untrusted_defaults, untrusted_clear, trusted_defaults}, case-insensitive
list [--user <USER_ID> | current] NAMESPACE
Print all defined keys.
NAMESPACE is one of {system, secure, global}, case-insensitive
安卓P Q R,手机的remount方法
go to setting -> system -> Developer options -> OEM unlocking
adb reboot bootloader
fastboot flashing unlock
press volume up key
fastboot reboot
adb root
adb disable-verity
adb reboot
adb root
adb remount
快速填满内存的两个方法
1.通过如下 adb 命令在 /mnt/sdcard/ 目录下产生一个名为 bigfile 的文件,让其自动增长到磁盘剩余空间大小
adb shell dd if=/dev/zero of=/mnt/sdcard/bigfile
最终显示结果如下:
/mnt/sdcard/bigfile: write error: No space left on device
3036001+0 records in
3036000+0 records out
1554432000 bytes transferred in 163.839 secs (9487557 bytes/sec)
能这样做的前提是 获取手机的 root 权限!并且 USB 设置不能设为 U盘功能!
2.使用微软提供的fsutil.exe命令来创建指定大小的文件
fsutil file createnew bigfile.txt 100000000
然后adb push到手机里面