1.解鎖設備以刷寫 build

2.進入fastboot模式進行unlock解鎖
adb reboot bootloader
fastboot flashing unlock
bill@BILL:~/03_tools/01_Android/SDK/build-tools/30.0.3$ fastboot flashing unlockOKAY [ 0.099s]
Finished. Total time: 0.099s


上鎖命令:
bill@BILL:~/03_tools/01_Android/SDK/build-tools/30.0.3$ fastboot flashing lock
OKAY [ 0.099s]
Finished. Total time: 0.099s

3.配置 ANDROID_PRODUCT_OUT環境變數,該環境變數指向我們編譯鏡像所在實際專案的目錄,形如:

4.刷寫鏡像
bill@BILL:~/03_tools/01_Android/SDK/build-tools/30.0.3$ fastboot -w flashall
--------------------------------------------
Bootloader Version...: c2f2-0.2-5940465
Baseband Version.....: g8150-00041-191016-B-5945070
Serial Number........: 98281FFBA007AH
--------------------------------------------
Checking 'product' OKAY [ 0.070s]
Setting current slot to 'a' OKAY [ 0.151s]
Sending 'boot_a' (65536 KB) OKAY [ 2.220s]
Writing 'boot_a' OKAY [ 0.525s]
Sending 'dtbo_a' (8192 KB) OKAY [ 0.400s]
Writing 'dtbo_a' OKAY [ 0.193s]
Sending 'vbmeta_a' (4 KB) OKAY [ 0.140s]
Writing 'vbmeta_a' OKAY [ 0.073s]
Sending 'vbmeta_system_a' (4 KB) OKAY [ 0.140s]
Writing 'vbmeta_system_a' OKAY [ 0.073s]
Rebooting into fastboot OKAY [ 0.070s]
< waiting for any device >
Sending 'super' (4 KB) OKAY [ 0.007s]
Updating super partition OKAY [ 0.010s]
Resizing 'product_a' OKAY [ 0.002s]
Resizing 'system_a' OKAY [ 0.002s]
Resizing 'system_b' OKAY [ 0.003s]
Resizing 'vendor_a' OKAY [ 0.002s]
Resizing 'vendor_b' OKAY [ 0.004s]
Resizing 'product_a' OKAY [ 0.002s]
Sending 'product_a' (267912 KB) OKAY [ 7.443s]
Writing 'product_a' OKAY [ 1.882s]
Resizing 'system_a' OKAY [ 0.044s]
Sending sparse 'system_a' 1/2 (524284 KB) OKAY [ 14.777s]
Writing 'system_a' OKAY [ 3.288s]
Sending sparse 'system_a' 2/2 (410848 KB) OKAY [ 11.982s]
Writing 'system_a' OKAY [ 2.693s]
Resizing 'system_b' OKAY [ 0.036s]
Sending 'system_b' (16680 KB) OKAY [ 0.534s]
Writing 'system_b' OKAY [ 0.378s]
Resizing 'vendor_a' OKAY [ 0.004s]
Sending sparse 'vendor_a' 1/2 (524284 KB) OKAY [ 14.629s]
Writing 'vendor_a' OKAY [ 3.310s]
Sending sparse 'vendor_a' 2/2 (207892 KB) OKAY [ 5.963s]
Writing 'vendor_a' OKAY [ 1.592s]
Erasing 'userdata' OKAY [ 1.054s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Erasing 'metadata' OKAY [ 0.073s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Rebooting OKAY [ 0.000s]
Finished. Total time: 91.001s
5.啟用 adb remount:
bill@BILL:~/03_tools/01_Android/SDK/build-tools/30.0.3$ adb root && sleep 1 && adb disable-verity && sleep 1 && adb reboot && adb wait-for-device root && sleep 1 && adb remount
restarting adbd as root
using overlayfs
Successfully disabled verity
Now reboot your device for settings to take effect
restarting adbd as root
remount succeeded
此程序中,設備平臺將會重啟,且開機后,界面顯示不正常,無法完整顯示整個界面,那么此時則需要我們進入下一步,

6.將所需的汽車專用檔案推送到設備:
bill@BILL:~/03_tools/01_Android/SDK/build-tools/30.0.3$ adb sync vendor
/vendor/: 7 files pushed, 0 skipped. 14.9 MB/s (322830 bytes in 0.021s)

前面應該用screencap命令截屏的,不過看到效果就可以了,最后再補上一張截屏,

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/277360.html
標籤:其他
