pretty code

2016年7月29日 星期五

Android OTA 差分包

1. Copy "/source/android/out/target/product/xxx/obj/PACKAGING/target_files_intermediates/xxx.zip" to old.zip
2. Modify source code and rebuild project
3. Copy "/source/android/out/target/product/xxx/obj/PACKAGING/target_files_intermediates/xxx.zip" to new.zip
4. Move to "/source/android" path, create "OTA" folder, copy old.zip and new.zip to this folder
5. Run "./build/tools/releasetools/ota_from_target_files -i OTA/old.zip OTA/new.zip OTA/diff.zip"
6. If there is no error, you will see the below message

1 的檔案是製作 OTA 檔案過程中的產物,差分包需要這個才能產生 patch,故不能拿平常 build 出來的 OTA 檔案。

另外,由於是用 old.zip 比較出來的差分包,故設備上的版本需和 old.zip 一樣,不然升級會失敗。

沒有留言: