fastboot的使用筆記,fastboot使用筆記

來源:互聯網
上載者:User

fastboot的使用筆記,fastboot使用筆記
1.將fastboot複製到/usr/bin/目錄

以後我們就可以直接使用fastboot命令了,而不需要每次都進入到fastboot目錄下,這個非常的方便:
(fastboot檔案目錄:baselinetwo/LINUX/android/out/host/linux-x86/bin)
將fastboot放到usr/bin目錄下的命令:

sudo cp fastboot /usr/bin/
2.燒錄boot.img

有時候,我們user版本的軟體出現了一些bug,但是我們要對這個bug進行調試分析,但是要保留bug現場的資料。那麼這個時候我們可以使用fastboot將eng版本的boot.img檔案燒入到手機中,就可以進行調試分析,並且還不會刪除手機現在的內容。

adb reboot bootloadersudo ./fastboot flash boot out/target/product/l9010/boot.imgsudo ./fastboot reboot
3.刷機時的幾個關鍵命令
adb reboot bootloaderfastboot devicesfastboot flash aboot out/target/product/$BUILD_PROJECT_NAME/emmc_appsboot.mbnfastboot flash boot out/target/product/$BUILD_PROJECT_NAME/boot.imgfastboot flash system out/target/product/$BUILD_PROJECT_NAME/system.imgfastboot flash userdata out/target/product/$BUILD_PROJECT_NAME/userdata.imgfastboot flash persist out/target/product/$BUILD_PROJECT_NAME/persist.imgfastboot flash recovery out/target/product/$BUILD_PROJECT_NAME/recovery.imgfastboot reboot
4.fastboot 簡單指令碼:

為了避免一個一個命令的輸入,非常的麻煩,我寫了一個非常簡單的指令碼:

fastboot_hexiaoming.sh

adb reboot bootloadersudo fastboot devicessudo fastboot flash aboot emmc_appsboot.mbnsudo fastboot flash boot boot.imgsudo fastboot flash system system.imgsudo fastboot flash userdata userdata.imgsudo fastboot flash persist persist.imgsudo fastboot flash recovery recovery.imgsudo fastboot reboot

這個指令碼的使用方式:
我到進入到目錄:baselinetwo/LINUX/android/out/target/product/project*****/

執行命令:

source '/home/android/desttop/fastboot_hexiaoming.sh' 

再輸入root密碼,就可以直接刷機了。

5.一位同事寫的的fastboot指令碼

fastboot_load.sh

#!/bin/shSRC_DIR=$PWDBUILD_FILE=$0BUILD_PROJECT_NAME=$1BUILD_BOOT_DIR=$SRC_DIR/boot_images/build/msBUILD_MODEM_DIR=$SRC_DIR/modem_proc/build/msBUILD_RPM_DIR=$SRC_DIR/rpm_proc/buildBUILD_TZ_DIR=$SRC_DIR/trustzone_images/build/msBUILD_AP_DIR=$SRC_DIR/LINUX/androidBUILD_COMMON_DIR=$SRC_DIR/common/buildBUILD_MODEM_SRC_DIR=$SRC_DIR/modem_procfunction usage(){    echo ""    echo "******************************************************************************************************"    echo "* Usage:                                                                                             *"    echo -e "*\033[31m $BUILD_FILE  <product name>\033[0m*"    echo "*                                                                                                    *"    echo "******************************************************************************************************"    echo ""    echo "Build product name are:"    echo -e "\033[31m1.l5510\033[0m"    echo -e "\033[31m2.l5320\033[0m"    echo -e "\033[31m2.l9010\033[0m"    echo ""}if [ -z "$BUILD_PROJECT_NAME" ] ; then    usage;else # wholeif [ $BUILD_PROJECT_NAME = "l5320" ] ; thenecho 'it is l5320'fiadb reboot bootloaderfastboot devicesfastboot flash aboot out/target/product/$BUILD_PROJECT_NAME/emmc_appsboot.mbnfastboot flash boot out/target/product/$BUILD_PROJECT_NAME/boot.imgfastboot flash system out/target/product/$BUILD_PROJECT_NAME/system.imgfastboot flash userdata out/target/product/$BUILD_PROJECT_NAME/userdata.imgfastboot flash persist out/target/product/$BUILD_PROJECT_NAME/persist.imgfastboot flash recovery out/target/product/$BUILD_PROJECT_NAME/recovery.imgfastboot rebootfi #whole

指令碼使用命令:
我們先進入到目錄:codebase/cts_9010/baselinetwo/
然後執行命令:

sudo ./fastboot_load.sh l9010

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.