VS Code中的React Native:将iOS设备的配置添加到launch.json [英] React Native in VS Code: add configuration for iOS Device to launch.json
问题描述
我在Visual Studio代码中打开了一个React Native项目,我正在尝试在物理连接的iOS设备上运行该项目.我直接从Xcode在设备上成功运行了该应用程序,但是从Visual Studio Code中遇到了问题.我相信我需要将设备的配置添加到launch.json中.我在那里尝试了不同的条目,但似乎无法正常工作.为连接的iOS设备添加配置的正确方法是什么?
I have a React Native project open in Visual Studio code, and Im trying to run the project on a physical connected iOS device. I successfully ran the app on the device directly from Xcode, but from Visual Studio Code I'm having issues. I believe I need to add a configuration for the device into launch.json. I have tried different entries in there but non seem to work. What is the proper way to add a configuration for a connected iOS device?
推荐答案
这是我最终拥有的,并设法使其在连接的设备上安装和启动.键name
的值似乎不能唯一地标识已连接的设备.它只是在设备调试"下拉菜单中显示的名称.
This is what I eventually had and managed to get it to install and launch on the connected device. The value for key name
does not seem to uniquely identify a connected device. Its just the name that shows in Device Debug drop down.
{
"name": "My iPad",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "ios",
"target": "device",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
这篇关于VS Code中的React Native:将iOS设备的配置添加到launch.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!