For example, use the command : ./flutter/tools/gn --android --debug --unoptimized
Finally, you will get the aritfact in the directory out/android_debug_unopt_arm64
Launch Android Flutter Application using a local parameter
fluter run --local-engine=android_debug_unopt_arm64 --local-engine-src-path={YourflutterEngineSrcPath}
Open the src/flutter directory in VSCode.
Important! Please ensure that the Android application running in the foreground as step 2 .
and open src/flutter direcotry !!!!! not src
open extension and fill the parameter.
· local-engine-src-path: The src directory of the Flutter source code.(Same as the --local-engine-src-path parameter in step 2.)
· local engine: The output directory of the engine, located in the out directory. (It varies depending on the compilation parameters, such as android_debug_unopt_arm64.)
· lpackage name: The package name of the Android application.
After clicking start, if everything is normal, the last prompt You can use press F5 to debug!! means success.
ANDROID_HOME is empty. Please set the ANDROID_HOME environment variable
Please successfully set the ANDROID_HOME environment variable in the configuration environment such as .zshrc or .bash_profile. If you confirm that the settings are successful but still report an error, this may be caused by the nodejs environment, you can try to restart vscode