adb/fastboot 总结

通过adb/fastboot实现设备recovery
adb reboot bootloader
fastboot erase userdata
fastboot erase cache
fastboot reboot
adb打开关闭色Linux权限

在这里插入图片描述

adb 实现截图

在这里插入图片描述

//在录像上,显示当前时间
--bugreport
//在cmd中显示录像过程的信息
--verbose
adb shell screencap -p /sdcard/screen.png

在这里插入图片描述

adb 实现录屏
adb 获取当前屏/surfaceflinger 信息
adb shell dumpsys SurfaceFlinger
adb shell dumpsys SurfaceFlinger --display-id //获取当前屏id信息
更多信息.可以通过修改参数获取
static const std::unordered_map<std::string, Dumper> dumpers = {
        {"--display-id"s, dumper(&SurfaceFlinger::dumpDisplayIdentificationData)},
        {"--dispsync"s,
         dumper([this](std::string& s) { mScheduler->getPrimaryDispSync().dump(s); })},
        {"--edid"s, argsDumper(&SurfaceFlinger::dumpRawDisplayIdentificationData)},
        {"--frame-events"s, dumper(&SurfaceFlinger::dumpFrameEventsLocked)},
        {"--latency"s, argsDumper(&SurfaceFlinger::dumpStatsLocked)},
        {"--latency-clear"s, argsDumper(&SurfaceFlinger::clearStatsLocked)},
        {"--list"s, dumper(&SurfaceFlinger::listLayersLocked)},
        {"--static-screen"s, dumper(&SurfaceFlinger::dumpStaticScreenStats)},
        {"--timestats"s, protoDumper(&SurfaceFlinger::dumpTimeStats)},
        {"--vsync"s, dumper(&SurfaceFlinger::dumpVSync)},
        {"--wide-color"s, dumper(&SurfaceFlinger::dumpWideColorInfo)},
};
adb wm命令
//设备尺寸
adb shell wm size
Physical size: 720x1440
//设备屏密度
adb shell density
Physical density: 320
//设置屏旋转方向
adb shell wm set-user-rotation lock 2
//去除锁屏界面
adb wm dismiss-keyguard
adb pm
//显示packagename apk,在系统中所在路径
 adb shell pm packagename
 //列出第三方应用
 adb shell pm list packages -3 -f
 -f: see their associated file.
-d: filter to only show disbled packages.
-e: filter to only show enabled packages.
-s: filter to only show system packages.
-3: filter to only show third party packages.
 //删除某个应用的数据
 adb shell pm clear com.android.xxx
 //禁用某个应用
 adb shell pm disable com.android.xxx
 //adb shell pm list permissions
   list permissions [-g] [-f] [-d] [-u] [GROUP]
    Prints all known permissions; optionally only those in GROUP.  Options are:
      -g: organize by group //按组
      -f: print all information//所以信息
      -s: short summary//太长
      -d: only list dangerous permissions//显示危险权限
      -u: list only the permissions users will see//用户可用的权限,第三方app
//是否包含某个feature
 adb shell pm has-feature android.hardware.camera.front
 // 列出所以features
 adb shell pm list features
 //列出所以测试apk
 adb shell pm list instrumentation -f
 //列出系统库文件
 list libraries

//显示某个应用的版本号
adb shell pm list packages -3 --show-versioncode
package:com.koushikdutta.vysor versionCode:1626807600

//获取应用对应的uid信息
adb shell pm list packages -U
package:com.qualcomm.qti.sensors.qsensortest uid:10111
package:com.android.theme.icon_pack.circular.android uid:10048
// 暂时未知
list staged-sessions
//列出设备存在的用户
list users
//隐藏某个应用
adb shell pm hide com.android.settings
//取消隐藏某个应用
adb shell pm unhide com.android.settings
//挂起某个应用
adb shell pm suspend com.android.settings
应用被挂起是,launcher界面应用icon显示灰色,点击提示“App isnot available”

//取消挂起某个应用
adb shll pm unsuspend com.android.settings


//获取当前系统支持最大user数
adb shell pm get-max-users
Maximum supported users: 4
//获取当前系统可同时存在的user数
adb shell pm get-max-running-users
adb root
adb root
restarting adbd as root
adb unroot
restarting adbd as non root
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值