Dos烧录脚本
Dos命令之前更改的太简单,现在加入判断是否进入fasboot模式和判断Android镜像是否存在;代码已经尽量简化成这样,dos命令功能还是比较不好用的,用了一下午的时间。。。
@echo off ::路径注意增加\
@set flashpath=Z:\DT380\LINUX\android\out\target\product\msm8953_64\
@set Dynamic_library_Path=Z:\msm8909\out\target\product\msm8909\obj\lib\sensors.msm8909.so
@set Sensors_conf=Z:\DT380\LINUX\android\vendor\qcom\proprietary\sensors\dsps\reg_defaults\sensor_def_qcomdev.conf
@set boot_image=%flashpath%boot.img
@set mbn_image=%flashpath%emmc_appsboot.mbn
@set userdata_image=%flashpath%userdata.img
@set system_image=%flashpath%system.img
@set persist_image=%flashpath%persist.img
@set ramdisk_image=%flashpath%ramdisk.img
@set recover_image=%flashpath%recovery.img
@set cache_image=%flashpath%cache.img
@set Dynamic_library=%Dynamic_library_Path%
@set Dynamic_library_Board_Path=/system/lib/ ::初始化,下面便是判断是否有文件
@set Image_Index=
@set Image_Current-path=
@set Image_Length=
@set Image[]-path=%boot_image%
@set Image[]-path=%mbn_image%
@set Image[]-path=%system_image%
@set Image[]-path=%persist_image%
@set Image[]-path=%ramdisk_image%
@set Image[]-path=%recover_image%
@set Image[]-path=%cache_image%
@set Image[]-path=%Dynamic_library%
::初始化 :LoopStart ::清空字符串
@set Image_Current-path= if %Image_Index% equ %Image_Length% goto BeginRun for /f "usebackq tokens=1,2,3 delims==-" %%a in (`set Image[%Image_Index%]`) do (
set Image_Current-%%b=%%c
) if exist %Image_Current-path% (
@echo 该路径%Image_Current-path%存在......
@echo.
) else (
@echo %Image_Current-path%
@echo 请确定该文件文件是否存在?如果不存在,请确定路径,打开脚本重新设置。10秒后关闭....
@ping -n 127.0.0.1>nul
exit
) @set /a Image_Index=%Image_Index%+ goto LoopStart :BeginRun
@echo 检查Android镜像文件已经完成,请继续下一步......
@echo. @echo 、同时烧录emmc_appsboot.mbn和boot.img
@echo 、烧录boot.img
@echo 、烧录aboot.img
@echo 、烧录persist.img
@echo 、烧录ramdisk.img
@echo 、烧录recovery.img
@echo 、烧录system.img
@echo 、烧录cache.img
@echo 、烧录所有镜像
@echo 、重新推进sensor.so
::@echo 、烧录并更新adsp架构下的sensor文件 @set /p option=请先设置路径后,再输入要烧录的选项: if "%option%" == "" (
adb root
adb wait-for-device
adb remount
@echo 重新推进sensor........
adb push %Dynamic_library% %Dynamic_library_Board_Path%
adb reboot
@echo 正在重启...... 5秒后关闭....
@ping -n 127.0.0.1>nul exit
) ::判断是否进入fastboot模式
fastboot devices>.txt
set /p message=<.txt
del .txt
if not defined message (
echo 正处于adb mode模式.....
adb wait-for-device
adb reboot-bootloader
) else (
echo 正处于fastboot mode模式.....
) @echo. if "%option%" == "" (
@echo 同时烧录emmc_appsboot.mbn和boot.img........
fastboot flash boot %boot_image%
fastboot flash aboot %mbn_image%
) if "%option%" == "" (
@echo 烧录boot.img........
fastboot flash boot %boot_image%
) if "%option%" == "" (
@echo 烧录aboot.img........
fastboot flash aboot %mbn_image%
) if "%option%" == "" (
@echo 烧录persist.img..........
fastboot flash persist %persist_image%
) if "%option%" == "" (
@echo 烧录ramdisk.img..........
fastboot flash ramdisk %ramdisk_image%
) if "%option%" == "" (
@echo 烧录recovery.img...........
fastboot flash recovery %recover_image%
) if "%option%" == "" (
@echo 烧录system.img........
fastboot flash system %system_image%
) if "%option%" == "" (
@echo 烧录cache.img...........
fastboot flash cache %cache_image%
) if "%option%" == "" (
@echo 烧录所有镜像.............
fastboot flash boot %boot_image%
fastboot flash aboot %mbn_image%
fastboot flash persist %persist_image%
fastboot flash ramdisk %ramdisk_image%
fastboot flash recovery %recover_image%
fastboot flash system %system_image%
fastboot flash cache %cache_image%
fastboot flash userdata %userdata_image%
) fastboot reboot
@echo 正在重启 请稍后......
adb wait-for-device
adb root
adb wait-for-device @ping -n 127.0.0.1>nul
adb shell dmesg > kmesg.log
@echo kernel log已经导出..... @echo [烧录成功,暂停5秒自动关闭]
@ping -n 127.0.0.1>nul
其中用到的相应内容有dos命令for循环的使用:
参考博客:http://blog.csdn.net/wh_19910525/article/details/7912440
Bat数组使用的情况:http://www.jb51.net/article/67630.htm
我自己整理的For f中的tokens和delims怎么用?直接拉上百度知道,整理得到的。就不管链接了,贴上我的有道云笔记链接就行了:http://note.youdao.com/noteshare?id=728873fd0d9b1ea50a73aed3d476135e&sub=FD0225FD68AC400C8C909FE85C293202
bat脚本回车命令是echo.
批处理语句判断变量是否为空的方法:http://www.bathome.net/thread-4046-1-8.html
综上所述:脚本好恶心!
Dos烧录脚本的更多相关文章
- shell、cmd、dos和脚本语言杂谈(转)
问题一:DOS与windows中cmd区别 在windows系统中,“开始-运行-cmd”可以打开“cmd.exe”,进行命令行操作. 操作系统可以分成核心(kernel)和Shell(外壳)两部 ...
- shell、cmd、dos和脚本语言区别和联系
问题一:DOS与windows中cmd区别 在windows系统中,“开始-运行-cmd”可以打开“cmd.exe”,进行命令行操作. 操作系统可以分成核心(kernel)和Shell(外壳)两部 ...
- DOS批处理脚本
先概述一下批处理是个什么东东.批处理的定义,至今我也没能给出一个合适的----众多高手们也都没给出----反正我不知道----看了我也不一定信服----我是个菜鸟,当然就更不用说了:但我想总结出一个“ ...
- shell、cmd、dos和脚本语言
问题一:Shell是什么? 操作系统可以分成核心(kernel)和Shell(外壳)两部分,其中,Shell是操作系统与外部的主要接口,位于操作系统的外层,为用户提供与操作系统核心沟通的途径.Shel ...
- qualcomm batch 烧录脚本
在烧录android系统候用到了windows的批处理文件,拿出来分析一下,顺便记录一下高通平台烧录系统的命令. @echo off :: @ :不显示后面的命令,就是后面的"echo of ...
- dos 下脚本编写须知
主题为:doc脚本运行结束后,不自动退出终端. 方法1假设你的bat名字叫rabbit.bat你可以新开一个bat,内容是start rabbit.bat然后这个新的bat是不会自动关闭的 注意,这个 ...
- dos脚本语法学习
一个dos批处理脚本,通过关键字搜索注册表并删除,坑很多,语法也很怪异,详情看注释 @echo off ::声明采用UTF-8编码,避免中文乱码问题,>NUL可以吞掉chcp输出的内容 chcp ...
- 小试牛刀C#作为脚本语言执行解密
背景 我们知道Unity3d是通过C#脚本语言的形式来实现游戏的逻辑代码编写,同样SCOTT服务器也设置了通过C#脚本来实现游戏逻辑,但是本文并不是想真正分析解密他们的运行机制,只是想通过自己的一个需 ...
- bat脚本基础教程
bat脚本就是DOS批处理脚本,就是将一系列DOS命令按照一定顺序排列而形成的集合,运行在windows命令行环境上.本文主要介绍bat脚本基础语法,希望完成本文内容学习之后具备基础的bat脚本开发能 ...
随机推荐
- Fillder Script语法
官方的Fiddler Script使用文档 http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrRes ...
- 全网最详细的Eclipse和MyEclipse里对于Java web项目发布到Tomcat上运行成功的对比事宜【博主强烈推荐】【适合普通的还是Maven方式创建的】(图文详解)
不多说,直接上干货! 首先,大家要明确,IDEA.Eclipse和MyEclipse等编辑器之间的新建和运行手法是不一样的. 全网最详细的MyEclipse里如何正确新建普通的Java web项目并发 ...
- 从零开始学 Web 之 CSS3(七)多列布局,伸缩布局
大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...
- Hadoop2源码分析-YARN RPC 示例介绍
1.概述 之前在<Hadoop2源码分析-RPC探索实战>一文当中介绍了Hadoop的RPC机制,今天给大家分享关于YARN的RPC的机制.下面是今天的分享目录: YARN的RPC介绍 Y ...
- SpringCloud断路器监控面板——Hystrix Dashboard
一.简介 Hystrix Dashboard是Hystrix的一个组件,Hystrix Dashboard提供一个断路器的监控面板,可以使我们更好的监控服务和集群的状态,仅仅使用Hystrix Das ...
- 读vue-0.6-text-parser.js源码
提取字符串中的表达式 var BINDING_RE = /\{\{(.+?)\}\}/; function parse(text) { // 找不到返回null if (!BINDING_RE.tes ...
- leetcode — zigzag-conversion
/** * Source : https://oj.leetcode.com/problems/zigzag-conversion/ * * Created by lverpeng on 2017/6 ...
- Postman接口测试_添加断言
1.设置环境变量 postman.setEnvironmentVariable("key", "value"); 例子: postman.setEnviron ...
- 146. LRU缓存机制
题目描述 运用你所掌握的数据结构,设计和实现一个LRU (最近最少使用) 缓存机制.它应该支持以下操作: 获取数据 get 和 写入数据 put . 获取数据 get(key) - 如果密钥 (key ...
- The Mac App Store isn't working. How to fix?
Q. The Mac App Store isn't working. How to fix? First you must have built-in Ethernet at 'en0'. So, ...