Vscode React Native run on device

Viewed 2946

I've followed many tutorials but I can't seem to make Vscode launch my React Native app on my device. I can run fine on simulator, but when I use the following configuration:

{
    "name": "Can's iPhone",
    "program": "${workspaceRoot}/.vscode/launchReactNative.js",
    "type": "reactnative",
    "request": "launch",
    "platform": "ios",
    "target": "device",
    "sourceMaps": true,
    "outDir": "${workspaceRoot}/.vscode/.react",
},

It just launches the app in last used simulator, instead of device. I've also tried:

{
    "name": "Can's iPhone",
    "program": "${workspaceRoot}/.vscode/launchReactNative.js",
    "type": "reactnative",
    "request": "launch",
    "platform": "ios",
    "target": "device",
    "sourceMaps": true,
    "outDir": "${workspaceRoot}/.vscode/.react",
    "runArguments": [
        "--device",
        "EXACT_NAME_OF_MY_DEVICE"
      ],
},

Where EXACT_NAME_OF_MY_DEVICE is exact name of my device, but no avail; it still runs in simulator. When I select my device in Xcode and run, it runs fine though (but I want to use Vscode to debug TS) What am I doing wrong?

0 Answers
Related