Add VS Code run-and-debug configurations for the Android emulator
F5 now builds, installs and attaches the debugger on the emulator, with the emulator booted automatically first, so there is no manual setup step between opening the project and stepping through code. tool/start_emulator.ps1 backs the preLaunchTask and is idempotent: it returns in about three seconds when a device is already attached, so re-launching the debugger cannot stack emulator instances. It fails with a useful message when the AVD is missing rather than hanging until a timeout. Five configurations rather than one, because they answer different questions. The profile-mode entry matters most for what comes next: debug builds run the Dart VM unoptimised, so the radar animation always looks worse than it is, and milestone 3's acceptance criterion is about whether it runs smoothly. The Windows entry trades the map away for a launch that takes seconds, which is worth it for pure UI work. Verified on this machine: the script cold-boots the AVD and waits for sys.boot_completed, and a second run exits immediately. Also removes the broken pixel_7_-_api_35 AVD, which could not boot because its system image was never installed. That returned 4.8 GB, taking free disk from 3.5 GB to 10.7 GB. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
// preLaunchTask for the emulator debug configurations. Idempotent: it
|
||||
// exits at once when a device is already attached, so pressing F5 twice
|
||||
// does not start two emulators.
|
||||
"label": "Avvia emulatore Android",
|
||||
"type": "shell",
|
||||
"command": "powershell",
|
||||
"args": [
|
||||
"-NoProfile",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", "${workspaceFolder}/tool/start_emulator.ps1"
|
||||
],
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "shared",
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Verifica (format, analyze, test, build)",
|
||||
"type": "shell",
|
||||
"command": "powershell",
|
||||
"args": [
|
||||
"-NoProfile",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", "${workspaceFolder}/tool/verify.ps1"
|
||||
],
|
||||
"group": { "kind": "build", "isDefault": true },
|
||||
"problemMatcher": ["$dart-build_runner"]
|
||||
},
|
||||
{
|
||||
"label": "Verifica rapida (senza build)",
|
||||
"type": "shell",
|
||||
"command": "powershell",
|
||||
"args": [
|
||||
"-NoProfile",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", "${workspaceFolder}/tool/verify.ps1",
|
||||
"-SkipBuild"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Rigenera i frame radar dimostrativi",
|
||||
"type": "shell",
|
||||
"command": "python",
|
||||
"args": ["${workspaceFolder}/tool/generate_mock_frames.py"],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Spegni emulatore",
|
||||
"type": "shell",
|
||||
"command": "adb",
|
||||
"args": ["emu", "kill"],
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user