Android 在Visual Studio代码上调试Nativescript

Android 在Visual Studio代码上调试Nativescript,android,genymotion,nativescript,Android,Genymotion,Nativescript,我正在尝试使用最新的Nativescript插件通过Visual Studio代码调试Nativescript演示应用程序,但失败了。此外,我还使用Genymotion emulator 这是我的launch.json: { "name": "Launch on Android", "type": "nativescript", "platform": "android", "request": "launch",

我正在尝试使用最新的Nativescript插件通过Visual Studio代码调试Nativescript演示应用程序,但失败了。此外,我还使用Genymotion emulator

这是我的launch.json:

    {
        "name": "Launch on Android",
        "type": "nativescript",
        "platform": "android",
        "request": "launch",
        "appRoot": "${workspaceRoot}",
        "sourceMaps": true,
        "diagnosticLogging": false,
        "emulator": false,
        "rebuild": true,
        "tnsArgs": [
            "--device 1"
        ]
    },
这就是我得到的结果:

Cannot resolve the specified connected device by the provided index or identifier. To list currently connected devices and verify that the specified index or identifier exists, run 'tns device'.
从终端运行tns设备:

┌───┬─────────────┬──────────┬─────────────────────┬──────────┬───────────┐
│ # │ Device Name │ Platform │ Device Identifier   │ Type     │ Status    │
│ 1 │ vbox86p     │ Android  │ 192.168.56.101:5555 │ Emulator │ Connected │
└───┴─────────────┴──────────┴─────────────────────┴──────────┴───────────┘
到目前为止,我尝试了以下方法:

重新安装VSC Nativescript插件 从git repo构建最新的Nativescript插件 通过geny“定制电话”启动 杀死ADB服务器
但是,我可以通过终端正常运行或livesync应用程序,但在Visual Studio代码中不起作用。

解决方案不是使用@Nikolay Tsonev提到的默认AVD emulator。

我让它工作-

On macOS systems, verify that you have added the following paths to the
PATH environment variable.

For Genymotion earlier than 2.6:
/Applications/Genymotion.app/Contents/MacOS/
/Applications/Genymotion Shell.app/Contents/MacOS/

For Genymotion 2.6:
/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS
/Applications/Genymotion Shell.app/Contents/MacOS/

For example: Run the following command 
export PATH=$PATH:/Applications/Genymotion\ Shell.app/Contents/MacOS/:/Applications/Genymotion.app/Contents/MacOS/
然后单击android上的launch,确保您的genymotion设备已启动并运行


有关更多信息,请点击此处-

是否进入VS代码,选择左侧的调试图标,然后从组合框中选择附加到ANDROID EMULATOR。或者关掉手表,启动ANDROID模拟器。我认为您可能会更幸运地使用ATTACH—在这种情况下,您不必指定设备。尝试使用默认的AVD Android Emulator—而不是使用Genymotion。您还可以从项目中删除.vscode文件夹,以确保launch.json文件没有损坏。YT视频从3年前开始不到一个月。最近有没有关于让Nativescript在VS代码中调试的视频?我在拼命挣扎:-