adb shell、fastboot常用命令(比较完整)

adb remount //登录

adb root //获取root权限

adb logcat > 2134324.txt //将当前日志保存到电脑

adb pull path/*.xml .  //从内存卡或者sd卡中拷贝文件到电脑

adb push path/*.xml path //从电脑拷贝文件到内存卡或者sd卡

adb reboot bootloader //重启进入刷os模式

adb shell ps //列出进程列表

adb shell kill 2114(pid ) //杀掉指定进程

adb shell rm path/*.xml //从内存卡或者sd删除资源

adb shell dumpsys meminfo com.android.* //打印某一进程的内存使用情况

adb shell fctest system reboot //高通平台

adb shell fctc -b normal //MTK平台

adb shell cat /proc/kmsg 

adb shell chmod 777 /dev/input/* 

adb shell chmod 777 /sys/class/adux_sensor/gesture_sensor/*

adb shell chown system:system /sys/class/adux_sensor/gesture_sensor/*

adb shell am startservice -n com.android.systemui/.SystemUIService //启动服务

adb shell am force-stop com.android.systemui/.SystemUIService //停止服务

adb shell monkey -p com.android.systemui -c android.intent.category.LAUNCHER -s 100 --hprof --ignore-crashes --ignore-timeouts

adb shell -s 10324 -v -v --monitor-native-crashes --pct-appswitch 20 --pct-syskeys 20 --pct-majornav 0 --pct-touch 40 --throttle 200 5000

adb version //列出版本号


fastboot reboot //fastboot下重启机器

fastboot flash boot boot.img //烧录系统引导程序


push jar文件到android系统目录下(需要root权限)
adb remount
adb shell
su
chmod 666 system\framework\CP_xxxx.jar
adb remount
adb push CP_xxxx.jar system/framework
adb push xxxxImpl_library.xml system/etc/permissions
adb reboot

apk签名
java -jar signapk.jar platform.x509.pem platform.pk8 input.apk output.apk 
%签名成功

java -Xmx512M -jar smali.jar out -o classes.dex
java -jar signapk.jar testkey.x509.pem testkey.pk8 app.apk app_signed.apk
java -jar smali.jar out -o classes.dex
java -Xmx512M -jar smali-1.2.2.jar out -o classes.dex

jar文件转化成odex文件
F:\project\dex\全自动odex\JoybinLin>adb shell dexopt-wrapper CP_xxxx.jar C
P_xxxx.odex

导出系统文件
adb pull /system/etc/hosts 文件名
adb pull /data/data/ d:\data

linux 下查看 .so 导出函数列表
cd ..
cd ..
cd bin
nm -D libcontext-jni.so >a.txt
nm -D libmaxfusion_hal.so >lib.txt
objdump -tT libmaxfusion_hal.so >libobj.txt


查看命令帮助
adb shell dumpsys --help


查看可用完整命令:
adb shell dumpsys -l


查看亮屏持有锁:(用途如查设置30s息屏后,等待30s仍然亮屏就要分析原因)
adb shell dumpsys power
cd /sys/power/ cat wake_lock 清除锁如echo powerservice > wake_unlock
adb shell dumpsys power | grep mScreenBrightness查看屏幕亮度

查看内存占用:(用途如查看某个应用内存泄漏、内存占用过大)
adb shell dumpsys meminfo


查看cpu占用:(用途如查看死机问题,未响应问题等)
adb shell dumpsys cpuinfo
https://stackoverflow.com/questions/24612982/interpreting-dumpsys-cpuinfo
adb shell top -m 4查看占有率最高的4个进程
https://superuser.com/questions/575202/understanding-top-command-in-unix



触摸事件:(用途如查看触屏未响应、不灵敏问题等)
adb shell input keyevent


查看服务列表
adb shell service list


查看当前所有窗口:
adb shell dumpsys SurfaceFlinger > sf.txt
    adb shell dumpsys window > window.txt
    adb shell dumpsys activity > activity.txt? ?


获取当前焦点的window(view)或者activity
 adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
 adb shell dumpsys activity | grep "mFoc"


adb shell dumpsys gfxinfo | grep Acceleration
Applications Graphics Acceleration Info:
Uptime: 16264702 Realtime: 28169900
uptimeMillis()计算手机启动以来(不包括休眠模式下)所执行的总时间,单位ms
elapsedRealtime() and elapsedRealtimeNanos()计算手机启动以来(包括深度休眠模式下)所执行的总时间,单位ms


查看系统参数
adb shell getprop


查看android版本
adb shell getprop ro.build.version.release系统版本如7.1.1
adb shell getprop ro.build.version.sdk查看sdk版本
adb shell getprop | grep "model\|version.sdk\|manufacturer\|hardware\|platform\|revision\|serialno\|product.name\|brand"查看厂商信息
getprop ro.serialno 查看机器的SN号
getprop ro.carrier 查看机器的CID号
getprop ro.hardware 查看机器板子代号
getprop ro.bootloader 查看SPL(Hboot)版本号


查看系统分辨率和dpi
adb shell wm size
adb shell wm density
adb shell dumpsys window displays  |  findstr init


启动停止activity/service
adb shell am <command>
adb shell am start -n action
adb shell am start com.some.package.name/.SubClassName
am start -a android.intent.action.CALL -d tel:10086
adb shell am force-stop com.some.package
adb shell am startservice com.some.package.name/.SubClassName
adb shell am kill com.some.package
adb shell am kill-all杀死全部的后台进程 
adb shell am broadcast -a android.intent.action.ACTION
adb shell am profile start pid /mnt/sdcard/profile.txt收集目标进程运行过程中的函数调用关系
adb shell am profile stop pid
adb shell am instrument -w com.some.package.name/android.support.test.runner.AndroidJUnitRunner进行Instrumentation测试


  DockObserver
  SurfaceFlinger
  获取GLSurfaceView 图层的 FPS 数据(检查界面流畅度)
  dumpsys SurfaceFlinger --latency-clear
  dumpsys SurfaceFlinger --latency window名
  会有128行数据,如果存在同名窗口会空行间隔追加另一组127行数据。
第一行代表刷新周期
第一列是开始绘制的时间
第二列是垂直同步的时间
第三列是硬件绘制完成的时间


这个命令写IMEI  
adb shell audioelectric start
adb shell audioelectric modem imei1 862508030003387
adb shell audioelectric modem imei2 862508032503384
adb shell audioelectric modem meid 99000455861234
adb shell baknvram


linux下执行cts测试
run cts –m CtsAppTestCases  –t android.app.cts.ActionBarTest#testAddTab --skip-preconditions


  accessibility辅助功能,给使用习惯非正常的人使用的。包括文字转语音,触觉反馈,手势操作,轨迹球和手柄操作等。
  account账户管理,手机常见的包括邮件、微信、新浪微博等
  activity
  alarm定时器,整个系统需要大量的alarm,这些alarm大部分不需要很精确,如果需要精确就会导致机器唤醒和电量的减少,所以由一个专门的alarm服务进行管理。
  Batch{4293d3a8 num=1 start=1369361 end=1407261}:每一个alarm-batch是一个类型,可以有多个alarm,4293d3a8对应的是Batch的id号
  https://stackoverflow.com/questions/28742884/how-to-read-adb-shell-dumpsys-alarm-output
  
  android.hardware.fingerprint.IFingerprintDaemon指纹识别,
  android.security.keystore安全签名
  android.service.gatekeeper.IGateKeeperService锁屏密码加密
  appops权限管理,查看某个应用已经被授予、拒绝或使用的权限
  appwidget桌面窗口小部件,手机上一般有天气派、日历、双时钟等
  assetatlas地图集服务,Asset Atlas Service将预加载资源合成为一个纹理,并且上传到GPU去
  audio声音服务,手机常见的声音有通话声音、系统声音、电话铃声和短信提示、音乐播放、闹铃、通知声音、dtmf、拍照声音、tts等,查看当前源的所属状态如是听筒还是麦克风。
  backup备份,查看参与备份的应用
  battery电池,查看当前的电量、是否充电、电池容量、充电技术如li-on、充电方式如usb充电等
  batteryproperties查看充电详情
  batterystats充电统计
  bluetooth_manager蓝牙管理
  carrier_config运营商配置,查看卡1、卡2运营商是否有配置的应用
  clipboard剪切板
  cloudsecurity云安全
  cneservice
  com.qualcomm.qti.qseeproxy
  commontime_management
  connectivity
  connectivity_metrics_logger
  connmetrics
  consumer_ir
  content
  contexthub_service
  country_detector
  cpuinfo
  crypto.cryptoManager
  dbinfo
  device_policy
  deviceidle
  devicestoragemonitor
  diskstats
  display
  display.qservice
  dns_listener
  dreams
  drm.drmManager
  dropbox
  eSEPowerManagerService
  ethernet
  extphone
  fingerprint
  gfxinfo
  goodix.fp
  gpu
  graphicsstats
  hardware_properties
  imms
  ims
  input
  input_method
  iphonesubinfo
  isms
  isub
  jobscheduler
  launcherapps
  location
  lock_settings
  mdtp
  media.audio_flinger
  media.audio_policy
  media.camera
  media.camera.proxy
  media.codec
  media.drm
  media.extractor
  media.imageeffect
  media.player
  media.radio
  media.resource_manager
  media.sound_trigger_hw
  media_projection
  media_router
  media_session
  meminfo
  midi
  mount
  netd
  netpolicy
  netstats
  network_management
  network_score
  network_time_update_service
  notification
  otadexopt
  package
  permission
  persistent_data_block
  phone
  pinner
  power
  print
  processinfo
  procstats
  qti.ims.ext
  qtitetherservice
  recovery
  restrictions
  rttmanager
  samplingprofiler
  scheduling_policy
  search
  secsupport
  securityRemote
  sensorservice
  serial
  servicediscovery
  shortcut
  simphonebook
  sip
  soundtrigger
  statusbar
  telecom
  telephony.registry
  textservices
  trust
  uimode
  uitechnoService
  updatelock
  usagestats
  usb
  user
  vendor.qcom.PeripheralManager
  vibrator
  voiceinteraction
  vrmanager
  wallpaper
  webviewupdate
  wifi
  wifip2p
  wifiscanner
  window
  ylcpl

What is this? This is All-in-One installer for 3 most needed PC tools for Android. No need to download big SDK for 3 small things. I originaly made it for my Kurdish friend AnGrY DuDe in early 2013. I saw another ADB installer on XDA, but it wasn't good enough for me so i'm finaly posting it here. It's very small and fast installer for tools and drivers. Features: Small - 9.18 MB Fast - 15 seconds install (many times its even less) AIO - ADB, Fastboot and also Drivers Easy to install - just run it and program will guide you Clean - ADB and Google Drivers from latest SDK Install process: 1. Run it (Require administrator privileges) 2. Press Y/Yes to install ADB and Fastboot or N/No to skip 3. Press Y/Yes to install ADB system-wide or N/No for current user only 4. Press Y/Yes to install Drivers or N/No to skip 5. Continue Driver installation 6. 15 seconds passed - finished! Notes: System-wide: ADB and Fastboot are installed to %SystemDrive%\adb directory, and added system-wide path. Current user only: ADB and Fastboot are installed to %UserProfile%\adb directory, and added path for current user. CMD can use ADB and Fastboot from any directory. Drivers are installed to system - no need to install them from directories. Installer automaticly decides if install 32-bit or 64-bit drivers. If anybody got problem with detecting device, go see picture guide howto_driver.zip If installation fails, then post here contents of "adb-installer.log" from desktop. (if there is any) If you have problem with driver enumeration in Windows 8.1 install update KB2917929 If you have older Google USB Driver installed, please uninstall it from Control Panel before installing new If you have previously installed it as system-wide and now you want it current user only (or vice-versa), it won't remove it, you must do it yourself. (at least for now)
进入fastboot adb命令是一个用于在Android设备上执行高级调试和刷机操作的命令行工具。Fastboot是一个Android设备启动过程的高级引导程序,用于将设备置于可编程的调试模式,以便进行各种操作。 要进入fastboot adb命令,您需要执行以下步骤: 1. 确保您的Android设备已连接到计算机,并且已启用开发者选项和USB调试模式。 2. 在设备上打开开发者选项。通常,您可以在设置中找到“关于手机”或“关于平板电脑”选项,然后连续点击版本号几次以启用开发者选项。 3. 进入开发者选项后,找到并启用USB调试模式。 4. 安装必要的ADB(Android Debug Bridge)工具。ADB是一个用于与Android设备进行通信的命令行工具,您需要安装它以便使用fastboot命令。 5. 打开终端或命令提示符窗口,并输入以下命令进入fastboot模式: ```php adb reboot bootloader ``` 这将使您的设备进入fastboot模式,并允许您使用adb命令与设备进行交互。 一旦进入fastboot模式,您可以使用adb命令执行各种操作,例如刷入新的系统镜像、安装应用、清除缓存等。您可以使用以下命令示例来执行这些操作: * 刷新系统镜像: ```php adb push <path_to_image> /sdcard/ adb reboot fastboot ``` * 安装应用: ```arduino adb install <path_to_apk> ``` * 清除缓存: ```arduino adb shell cacheclean ``` 这些只是一些基本的示例,fastboot adb命令提供了许多其他功能和选项,可以根据您的需求进行探索和使用。请注意,在进行任何高级刷机操作之前,请务必备份您的数据并仔细阅读相关文档和指南,以避免数据丢失或设备损坏。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值