---
title: "备份我的源码烧录的sh文件"
author: "txlong_onz"
date: "2012-07-16T10:39:11Z"
tags: ["Android", "Flash", "Ubuntu", "sh"]
categories: ["移动开发"]
slug: "sh"
draft: false
lastmod: "2012-07-16T10:39:11Z"
id: 1594890
url: "https://txlong-onz.iteye.com/blog/1594890"
---

烧录编译的img文件：

01.tofastboot.sh

```
echo "reboot devices to bootloader mode ..."
fastboot reboot-bootloader
```

02.lsdev.sh

```
echo "connected devices:"
fastboot devices
```

03.erase.sh

```
echo "erase boot ..."
fastboot erase boot

echo "erase recovery ..."
fastboot erase recovery

echo "erase system ..."
fastboot erase system

echo "erase userdata & cache ..."
fastboot -w
```

04.flash-img.sh

```
echo "flash boot ..."
fastboot flash boot.img

echo "flash recovery ..."
fastboot flash recovery.img

echo "flash system ..."
fastboot flash system.img
```

 05.reboot.sh

```
echo "reboot devices now ..."
fastboot reboot
```