androiddartflutterhotdeploy

How to persist the state of hot deploy before unplugging USB on Android Studio?


I tested some easy application on Flutter in Android Studio and did the following:

  1. I took HelloWorld program as a basis for changes.
  2. I made a change on app in Android Studio and on press of enter the change was on screen of my device.
  3. I unplugged the connection USB from my computer and closed the app on phone.
  4. I opened again to the app and it was in state on which it was before step 2.

Is this the supposed behavior in Flutter, that changes that are made during the hot deploy, are not persisted to phone? What is the way to get them persisted after the blocks are in correct place, or is the only way to somehow build the app as realease and deploy in some other way after that?

My idea is to play around with Flutter on Android and my wish is to showcase the accomplishments when ever I have unplugged the device.


Solution

  • If you want to keep the app on your phone, instead do a flutter build or flutter build --release

    And then install that binary on your phone.

    Unplugging the phone during debug session and keep using the installed app is not intended.