Debug React Native app on iPhone with VSCode - react-native

I have VSCode installed on Ubuntu with React Native Tools 0.4.1 installed. I can't figure out how to use debug with it. Tried to follow this tutorial with no luck - it just stacks on loading and nothing happens.
My launch.json is created automatically and looks like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Android",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "android",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
{
"name": "Debug iOS",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "ios",
"target": "iPhone 5s",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
{
"name": "Attach to packager",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "attach",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
{
"name": "Debug in Exponent",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "exponent",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
}
]
}

Related

Does Anyone Know This Error? React-Native

I am developing React-Native Android application. I get this line when debugging. I wonder why ?
Nobody answers. Two days passed. Help me
React-native Android Debugger Error Code 712 and 303
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to packager",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "attach"
},
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"name": "Debug macOS",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "launch",
"platform": "macos"
},
{
"name": "Debug Android",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "launch",
"platform": "android"
},
]
}

Define vscode variables

Is there a way to define variables in vscode for use in launch.json?, I only want some variable that will be common to different configurations, let's say TESTING_USER="ABC"
{
"version": "0.2.0",
// it would be ideal to set it here somehow,
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Node",
"runtimeArgs": ["idUser", "${TESTING_USER}"],
},
{
"type": "chrome",
"request": "launch",
"name": "Chrome",
"url": "http://localhost:3000?${TESTING_USER}",
}
],
}
The only solution I've found would be creating an entry in settings.json and then referring it with ${config:xxxx} but I wonder if there's a more direct way.
You can use the extension Command Variable and use a file with key-value pairs
Another possibility is to use the command: extension.commandvariable.transform
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Node",
"runtimeArgs": ["idUser", "${input:TESTING_USER}"],
},
{
"type": "chrome",
"request": "launch",
"name": "Chrome",
"url": "http://localhost:3000?${input:TESTING_USER}",
}
],
"inputs": [
{
"id": "TESTING_USER",
"type": "command",
"command": "extension.commandvariable.transform",
"args": { "text": "ABC" }
}
]
}

Can't run or debug react native

I am using Visual Code, and just created an react native app through create-react-app NewTest
I already installed React Native Tools in vscode
The app is running just fine in my android device through Expo installed on it. The problem is that I can't run it on my simulator which is genymotion mobile
I get this error:
[Error] Error: Unknown error: not all success patterns were matched
My launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
},
{
"name": "Debug Android",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "android",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
{
"name": "Debug iOS",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "ios",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
{
"name": "Attach to packager",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "attach",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
{
"name": "Debug in Exponent",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "exponent",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
}
]
}
I just started the getting started tutorial and I have no idea about why it is not working. I already search over the internet and could not find much help.
Genymotion device
Error image

.NET Core Debugging stopped working in Visual studio Code 1.9

I've updated to visual studio code 1.9 and suddenly I can't debug my .NET Core Application. If I look into the launch.json it says the "type: coreclr" is not accepted. Does anyone know what's different what do I need to change? I've left my config file below.
Thanks in advance :-)
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.1\\BUnity.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "node",
"request": "attach",
"processId": "${command.pickProcess}"
},
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.1\\BUnity.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
}
]
}
Somehow I desinstalled the C# Extension. It's required to debug .NET Core applications

Debugging nwjs app in VSCode

I am using VSCode as my primary JS ide and currently working on a NWJS(node-webkit) app. I want use the debugger available in VSCode. Can anyone guide me through how the launchjs should look like.
Can you please try to below lauch.json. it is working for me.
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/camera/app.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
}
]
}