2016-10-12 4 views
1

Ich versuche und fehlgeschlagen, Nativescript-Demo-Anwendung über Visual Studio Code mit neuesten Nativescript-Plugin zu debuggen. Außerdem verwende ich Genymotion Emulator ..Debugging Nativescript auf Visual Studio-Code

Das ist mein 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" 
     ] 
    }, 

und das ist, was ich für Ergebnis:

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'. 

Lauf tns Gerät vom Terminal:

┌───┬─────────────┬──────────┬─────────────────────┬──────────┬───────────┐ 
│ # │ Device Name │ Platform │ Device Identifier │ Type  │ Status │ 
│ 1 │ vbox86p  │ Android │ 192.168.56.101:5555 │ Emulator │ Connected │ 
└───┴─────────────┴──────────┴─────────────────────┴──────────┴───────────┘ 

Bisher habe ich folgendes versucht:

  • Neuinstallieren VSC Nativescript Plugin
  • Gebäude neueste Nativescript Plugin von git Repo
  • Starten über --geny 'Custom Phone'
  • Töten ADB Server

Allerdings kann ich oder LiveSync Anwendung ausführen normalerweise über Terminal, aber das gleiche funktioniert nicht in Visual Studio Code.

+0

Hast du in VS-Code gehen, wählen Sie das DEBUG-Symbol auf der linken Seite und wählen Sie dann ATTACH TO ANDROID EMULATOR aus dem Kombinationsfeld. Oder töte die Uhr und mache einen ANROID EMULATOR. Ich denke, Sie könnten mehr Glück mit ATTACH haben - in diesem Fall müssen Sie nicht das Gerät # angeben. – dashman

+3

Versuchen Sie, den Standard-AVD-Android-Emulator zu verwenden - https://github.com/NativeScript/docs/blob/master/tooling/android-virtual-devices.md, anstatt 'Genymotion' zu verwenden. Sie können auch den '.vscode'-Ordner aus Ihrem Projekt löschen, um sicherzugehen, dass die 'launch.json'-Datei nicht beschädigt ist. –

Antwort

0

Die Lösung war Standard-AVD-Emulator zu verwenden, wie @Nikolay Tsonev erwähnt.

2

ich es Arbeit bekommen -

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/ 

dann klicken Sie auf Start auf Android, bevor sicher, dass Ihr genymotion Gerät ist und läuft.

Für weitere Informationen hier überprüfen - https://www.nativescript.org/nativescript-for-visual-studio-code

Verwandte Themen