Android 5.x OTA Update官方文档(二,OTA 打包工具)

写在前面:

OTA

一、整包升级

一个整包包含了

下面我们使用发布的打包工具来创建一个整包。

1.创建target-files.zip

%.build/envsetup.sh&&lunchtardis-eng%mkdirdist_output%makedistDIST_DIR=dist_output[…]%ls-ldist_output/*target_files*-rw-r—–1usereng69965275Sep2915:51tardis-target_files.zip

2.创建整包

%./build/tools/releasetools/ota_from_target_files\dist_output/tardis-target_files.zipota_update.zipunzippingtargettarget-files…done.%ls-lota_update.zipota_update.zip

注!如果你看到的编译命令与工作中不一致,是由于不同平台(MTK、高通等)进行进一步封装,,这里的文档只是做个参考。

二、增量升级

一个增量包包含了一系列相对于现有设备的二进制补丁,增量包相对来说比较小。因为如果文件没有发生变化就不会有内容包含在更新包中,如果文件文件相对于前一个版本改变很小,那么增量包中仅仅是包含两个文件不同的内容。

那么制作增量包就需要

%./build/tools/releasetools/ota_from_target_files\-iPREVIOUS-tardis-target_files.zip\#makeincrementalfromthisolderversiondist_output/tardis-target_files.zipincremental_ota_update.zipunzippingtargettarget-files…unzippingsourcetarget-files…[…]done.%ls-lincremental_ota_update.zipincremental_ota_update.zip

进行增量升级的时候必须保证设备中当前运行的版本与增量包oldtarget_files.zip的版本保持一致。否则会安装中断。因此应在更新包安装前进行校验。

三、更新包

更新包是

UpdatebinalyAPIversionnumber.二进制文件会通过这个参数增大它的值。

Filedescriptorofthecommandpipe.

Filenameoftheupdatepackage.zipfile.

原文如下:

Thetool provided inbuild/tools/releasetoolscan build two types of package:fullandincremental. The tool takes thetarget-files.zip file produced by the Android build system as input.

Full updates

Afullupdate is one where the entire final state of the device (system, boot, and recovery partitions) is contained in the package. As long as the device is capable of receiving the package and booting the recovery system, the package can install the desired build regardless of the current state of the device.

Example: Using the release tools to build a full update for the hypotheticaltardisdevice:

# first, build the target-files .zip […]-rw-r—– 1 user eng 69965275 Sep 29 15:51 tardis-target_files.zip

The target-files .zip contains everything needed to construct OTA packages.

dist_outputunzipping target targetdone.

The ota_update.zip is now ready to be sent to test devices (everything is signed with the test key). For user devices, generate and use your own private keys as detailed inSigning builds for release.

Incremental updates

Anincrementalupdate contains a set of binary patches to be applied to the data already on the device. This can result in considerably smaller update packages:

Files that have not changed don’t need to be included.Files that have changed are often very similar to their previous versions, so the package need only contain an encoding of the differences between the two files.

You can install the incremental update package only on a device that has the old or source build used when constructing the package. To build an incremental update, you need the target_files .zip from the previous build (the one you want to updatefrom) as well as the target_files .zip from the new build.

# make incremental from this older version dist_outputunzipping target targetunzipping source target

This build is very similar to the previous build, and the incremental update package is much smaller than the corresponding full update (about 1 MB instead of 60 MB).

Note:To generate ablock-based OTAfor subsequent updates, pass the–blockoption toota_from_target_files.

人生的路无需苛求。只要你迈步,路就在你的脚下延伸。

Android 5.x OTA Update官方文档(二,OTA 打包工具)

相关文章:

你感兴趣的文章:

标签云: