在 Android Studio 3.5 如何關閉 Instant Run ?
在過往 Instant Run一直都有讓人詬病的問題,預設 IDE 環境下 Instant Run 是開啟,此功能可以加速建置編譯速度,但常常在關鍵時刻,老闆在火、PM不斷添油,火燒屁股情況下,遇到發現明明程式碼寫對了,但執行結果不如預期,找半天原來是程式碼沒有確實被重新編譯。大部分人只要被撞過一次,大概都會立馬關閉 Instant run 功能,一輩子都不想在開啟。
這項問題,似乎 IDE 開發團隊也發現了,在 Android Studio 3.5 移除了 Instant Run,所以在設定選項沒有可開啟或關閉的選項。而是改成 「Apply Changes」。
Apply Changes 功能介紹
Apply Changes and Restart Activity
建置有變化的的檔案並重新開啟 Activity
Apply Code Changes
建置速度最快,僅建置有變化的的檔案
Run
建置速度最慢,但程式與資源檔一定會重新編譯並執行
參考資料
Use Apply Changes
https://developer.android.com/studio/run#apply-changes
https://developer.android.com/studio/run#apply-changes
Android Studio 3.5: Project Marble goes into stable
https://android-developers.googleblog.com/2019/08/android-studio-35-project-marble-goes.html
https://android-developers.googleblog.com/2019/08/android-studio-35-project-marble-goes.html
關鍵字
disable android Instant Run
關閉 Instant Run
關閉 Instant Run