I want to run a React Native app on an iPhone, not on the simulator, using VSCode.
I came across this past question but cannot get various things here, including the accepted answer to work. React Native in VS Code: add configuration for iOS Device to launch.json
The original launch.json which launches/runs the simulator is:
{
"name": "Debug iOS",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "launch",
"platform": "ios"
}
If I try augmenting that to be this:
{ "name": "Debug iOS", "cwd": "${workspaceFolder}", "type": "reactnative", "request": "launch", "target": "device", "runArguments": ["--device", "iPhone"], "platform": "ios" }
(iPhone is the name of my connected device as showing in Xcode)
Or use the accepted answer verbatim:
{ "name": "My iPad", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "ios", "target": "device", "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" }
Then neither work, in both cases there is the same error:
An error occurred while launching the application. Error while executing command '/Users/me/Desktop/Checkouts/ReactNative/AwesomeProject/node_modules/.bin/react-native run-ios --device iPhone --no-packager --verbose': Error while executing command '/Users/me/Desktop/Checkouts/ReactNative/AwesomeProject/node_modules/.bin/react-native run-ios --device iPhone --no-packager --verbose' (error code 101) (error code 303)
Anybody got this working and knows what the error/problem/fix is?