nisargjhaveri / vscode-ios-debug

iOS debugging in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=nisargjhaveri.ios-debug
86 stars 10 forks source link

Pass environment variables to `args` #8

Closed markst closed 2 years ago

markst commented 2 years ago

I'd like use Environment Variables in my args array such as:

{
  "label": "xcodebuild",
  "type": "process",
  "command": "xcodebuild",
  "args": [
    "-configuration",
    "Debug",
    "-sdk",
    "${command:ios-debug.targetSdk}",
    "-derivedDataPath",
    "${derivedDataPath}", 
    "-allowProvisioningUpdates",
    "ARCHS=arm64"
  ],
  "group": {
    "kind": "build",
    "isDefault": true
  },
  "dependsOn": ["xcodegen"]
}

But the xcode build command doesn't replace the variables:

The terminal process "xcodebuild '-configuration', 'Debug', '-sdk', 'iphonesimulator', '-derivedDataPath', '$derivedDataPath', '-allowProvisioningUpdates', 'ARCHS=arm64'" terminated with exit code: 65.
markst commented 2 years ago

If I create a example shell task:

{
  "version": "2.0.0",
  "options": {
    "env": {
      "derivedDataPath": "~/Library/Developer/Xcode/DerivedData/xx"
    }
  },
  "tasks": [
    {
      "label": "echo",
      "type": "shell",
      "command": "echo",
      "args": [
        "-configuration",
        "Debug",
        "-sdk",
        "${command:ios-debug.targetSdk}",
        "-derivedDataPath",
        "${derivedDataPath}", 
        "-allowProvisioningUpdates",
        "ARCHS=arm64"
      ]
    },

the output is as follows:

-configuration Debug -sdk iphonesimulator -derivedDataPath ~/Library/Developer/Xcode/DerivedData/xx -allowProvisioningUpdates ARCHS=arm64
markst commented 2 years ago

Oh I see, this is due to process type rather than being a vscode-ios-debug related issue.