1. 程式人生 > >Android 8.0 啟動速度優化工具

Android 8.0 啟動速度優化工具

在Android 8.0上面,google進行了啟動速度的優化,但是對於開發者來說,追求更快的速度是必須的。 這邊就介紹一個android啟動速度優化的工具,bootchart。 bootchart在5.0的時候就以推出,但是現在的使用方式有了一些調整,下面就簡單介紹一下. 首先,bootchart在8.0上面已經編譯進了boot的image中,需要我們啟用使用。 詳細步驟如下: 1. 在ubuntu上面,需要安裝bootchart:
sudo apt-get install bootchart
2.  連一個userdebug的手機
adb root
adb remount
adb shell touch /data/bootchart/enable
這樣就激活了bootchart的應用。 3. 重啟一下手機
adb reboot
4. 將bootchart給匯出到本地Ubuntu
adb pull /data/bootchart/
5. 使用bootchart的指令碼合成分析的啟動過程圖
system/core/init/grab-bootchart.sh
6. 開啟bootchart圖即可分析啟動的耗時分析。