1.新增Targets
再 Xcode 中新增需要的Targets 捂人,并在Project 中確保配置正確
image.png
2. VS Code 配置
-
創(chuàng)建 .vscode/launch.json 文件路徑
image.png
image.png
3. 添加配置
{
// 使用 IntelliSense 了解相關(guān)屬性蓝谨。
// 懸停以查看現(xiàn)有屬性的描述。
// 欲了解更多信息茂卦,請?jiān)L問: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Runner",
"request": "launch",
"type": "dart"
},
{
"name": "Test",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"args": [
"--flavor",
"TestTarget", // 必須要和xcode中配置的target 名字一至
]
},
]
}