Launching a Very Good App from VS Code
Want to launch your Very Good app directly from VS Code? It's easy by creating a new profile.
If you create an app using the Very Good CLI, then you may have noticed that you can't launch it in an android emulator by default. With a couple quick changes we can get it running.
First, we need to create a launch.json
file for our project inside the .vscode
folder, then add a profile to it.
The file should look something like this with our new profile "App (Flutter)" in it:
{
"version": "0.2.0",
"configurations": [
{
"name": "App (Flutter)",
"program": "lib/main_development.dart",
"args": [
"--flavor",
"development",
"--no-sound-null-safety" // this is only required if you need to include files without proper null safety support
],
"cwd": "app",
"request": "launch",
"type": "dart"
}
]
}
A couple comments on specific lines:
"name"
- this can be whatever you want to describe this profile"program"
- this is the main file that will be launched. The other options for a very good app arelib_staging.dart
andlib_production.dart
."args"
- these are the command line args that our launch command requires
If you want to run the staging build, then use the lib_staging.dart
file as your "program"
and update the --flavor
to "staging"
. The same steps for the production build.