您的位置:首页 > 移动开发 > Android开发

android adb与fastboot 常用命令

2016-11-13 13:35 357 查看
“adb logcat -b radio -b main -c”按回车,清空之前的log。
adb logcat -b main -b system -b radio -v time >logcat.txt
重启到Recovery界面adb reboot recovery重启到bootloader界面adb reboot bootloaderadb wait-for-device #等待设备adb reboot-bootloader #这个是重启到bootloader界面 默认是fastboot。可以先重启到这里再刷入boot.imgfastboot flash boot boot.img #这个是刷入boot的命令。官解的要手动刷一次。fastboot flash recovery recovery.img #刷入recovery 已有recovery的可以跳过。fastboot erase boot #擦除boot分区以下两个是一样的 有加-w 跟 没有加-w 的区别fastboot erase system -w #擦除system分区 擦除 userdata分区和cache分区fastboot erase system #擦除system分区fastboot erase cache #擦除cache分区fastboot erase userdata #擦除userdata分区fastboot update update.zip #将update.zip刷入fastboot reboot #重启手机1.Fastboot简介Fastboot是Android快速升级的一种方法,Fastboot的协议fastboot_protocol.txt在源码目录./bootable/bootloader/legacy下可以找到。Fastboot客户端是作为Android系统编译的一部分,编译后位于./out/host/Linux-x86/bin/fastboot目录下。sudo fastboot flash bootloader u-boot.binsudo fastboot flash kernel uImagesudo fastboot flash system system.imgsudo fastboot flash userdata userdata.imgsudo fastboot flash ramdisk ramdisk-uboot.imgsudo fastboot erase cachefastboot erase config一次烧写boot,system,recovery分区:    (1)创建包含boot.img,system.img,recovery.img文件的zip包。    (2)执行:fastboot update {*.zip}烧写开机画面:    fastboot flash splash1 开机画面2.2 重启系统sudo fastboot reboot2.3 不烧写flash情况下调试sudo fastboot boot uImage 或者u-boot.bin2.4 查看版本号sudo fastboot getver:version2.5 复位到bootloadersudo fastboot reboot-bootloader2.6 命令格式主机端发送字符串的命令,字符串小于等于64个字节,客户端首先返回四个字节的内容,是OKAY、FAIL、DATA、INFO之一,随后跟着是信息或数数据。2.7 清空分区fastboot erase {partition}   例:fastboot erase boot或fastboot erase system等。fastboot erase bootfastboot erase systemfastboot erase datafastboot erase cache上面的命令也可以简化成一条命令fastboot erase system -wAndroid 擦除nv数据:adb reboot bootloaderfastboot erase fsgfastboot erase fscfastboot erase modemst1   ///擦除mdem文件fastboot erase modemst2   ///擦除mdem文件---------------------------------------刷入新的modem文件adb rootadb remountadb push "mbn_file"  /system/etc/firmware/modem_config/xxxproject/adb reboot进入adb reboot recovery模式  直接清除数据(与恢复出厂设置一要)进入强制刷机模式adb reboot edl打印手机TP坐标:adb shell getevent adb logcat 命令A 同时过滤多个应用的Tag语法:adb logcat *:S TAG1 TAG2 TAG3  或   adb logcat -s TAG1 TAG2 TAG32. 查看指定包名的安装路径root@wt89536:/ # pm path com.android.settings 5.清除应用数据root@wt89536:/ # pm clear com.android.fingerprint adb logcat -b main -v time>app.log  打印应用程序的 logadb  shell   “getprop | grep sn” 属性搜索adb logcat -b radio -v time> radio.log 打印射频相关的 log , SIM STK 也会在里面, modem 相关的 ATcommand 等,当然跟 QXDM 差的很远了。adb logcat -b events -v time>events.log  打印系统事件的日志,比如触屏事件。2. 查看指定包名的安装路径root@wt89536:/ # pm path com.android.settings 4.launcher上是否显示指定应用root@wt89536:/ # pm enable com.android.fingerprint Package com.android.fingerprint new state: enabled或root@wt89536:/ # pm unhide com.android.fingerprint Package com.android.fingerprint new hidden state: falseroot@wt89536:/ # pm disable com.android.fingerprint Package com.android.fingerprint new state: disabled或root@wt89536:/ # pm hide com.android.fingerprint Package com.android.fingerprint new hidden state: true5.清除应用数据root@wt89536:/ # pm clear com.android.fingerprint 手机刷机方式:打开 USB调试,使用命令 adb reboot edl        (进入9008模式),方法2,当有时刷了一个有问题的版本,只能进入fastboot却不能连接adb时,可用下面这方式(该方法本人未成功过,一直提示找不到该命令): C:\Users\xxx>fastboot oem edl...FAILED (remote: unknown command)finished. total time: 0.001s进入手机fastboot模式,执行命令 fastboot oem edl进入 高通模式9008模式 时,手机黑屏,但是连接上电脑有反应,设备管理器 可以见到 一台串口为9008的设备方法三:确保手机已处于关机状态中,同时一起按住 音量上键 与 音量下键  ,然后连接USB数据线,当端口识别正确即可进入9008模式(),
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: