问题
The key/value pair in my project's settings.json that should change the default ios simulator used by react native does nothing. You can see in this picture that the logs show vscode trying to open an iPhone 6
although I've explicitly requested an iPhone X
:
I rebooted vscode after adding this setting, of course. I've also tried uninstalling and reinstalling my copies of vscode, the vscode react native plugin, the ios 12.0 runtime, and Xcode. I've tried deleting all simulators except the one I want.
This is a problem because my recently upgraded copy of Xcode will no longer build to an iPhone 6, so I am unable to use the vscode react native tools.
回答1:
My problem was that I had specified a simulator in my launch.json:
{
"name": "Debug iOS",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "ios",
"sourceMaps": true,
"cwd": "${workspaceRoot}"
"target": "iPhone 6",
},
I removed the "target": "iPhone 6"
key/value pair and the correct simulator booted up.
来源:https://stackoverflow.com/questions/58139569/vscode-custom-rn-simulator-setting-broken