preface
Today, when studying the commands of Flutter devices, I found that Flutter also has a run command, and then used it to find a new world. It turns out that the flutter run command helps debug real machine code
Run flutter Run (instead of Android Studio Debug button operation)
Show the following
Launching lib/main.dart on MI 6X indebug mode... Initializing gradle... 0.7 s Resolving dependencies... 1.4 s Running Gradle task'assembleDebug'. Running Gradle task'assembleDebug'. Done 12.1 s Built build/app/outputs/apk/debug/app - debug. Apk. Installing the build/app/outputs/apk/app. The apk... 4.9 S Syncing Files to device MI 6X... 1,864ms 🔥 To hot reload changeswhile running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on MI 6X is available at: http://127.0.0.1:35407/rj63pWKT6HI=/
For a more detailed help message, press "h". To detach, press "d"; to quit, press "q". I/example.rattra(31980): ProcessProfilingInfo new_methods=387 is saved saved_to_disk=1 resolve_classes_delay=8000 The display information can be divided into two parts, separated by the blank line in the middle. The eight lines above the blank line are all packaged, installed and deployed to the test machine (mine is the real machine, Mi 6X). The last part with the symbol 🔥 is the most important, which is translated as follows: To make a hot deployment change (meaning you changed the code or added a resource file, etc.), click on the keyboard"r"If you want to restart (or rebuild), press the button on the keyboard"R"(Shift+ R).Copy the code
conclusion
Start the flutter run command. After that, if you have modified the DART file, or anything else, press down"r"If you want to redeploy, press Shitf+ R. I think the good thing about this is that Android Studio is so smart, I changed the Dart file, I used to Ctrl+ S, and then he hot deployed me, but I didn't change it, I just wrote one line of code and there was a syntax error. I'm just used to Ctrl+ S, and Android Studio redeploy requires button action, I don't like it, I like to use commands to do it!Copy the code