Reputation: 6511
I'm trying to launch an Ionic app on my Android device from VS Code, using the vscode-cordova extension.
My launch.json
looks like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Run android on device",
"type": "cordova",
"request": "launch",
"platform": "android",
"target": "device",
"sourceMaps": true,
"cwd": "${workspaceFolder}",
"ionicLiveReload": true
}
]
}
But I get following error message:
[cordova-tools] Error processing "launch": The Ionic live reload server exited unexpectedly
The debug console does offer a bit more information:
Launching for android (This may take a while)...
Starting Ionic dev server (live reload: true)
The Ionic live reload server exited unexpectedly
How can I overcome this issue?
Upvotes: 1
Views: 2010
Reputation: 6511
Trying to run ionic cordova run android -l
revealed the issue:
[ERROR] Multiple network interfaces detected!
You must select an external-facing IP for the dev server that your device or emulator has access to with the --address option.
So adding the --address
option to the runArguments
of my launch.json as lined out in the readme resolved my issue:
{
"version": "0.2.0",
"configurations": [
{
"name": "Run android on device",
"type": "cordova",
"request": "launch",
"platform": "android",
"target": "device",
"sourceMaps": true,
"cwd": "${workspaceFolder}",
"ionicLiveReload": true,
"runArguments": [
"--address 192.168.1.2"
]
}
]
}
Where 192.168.1.2 is the ip address of my dev laptop. Also make sure this ip address is reachable from your device.
Upvotes: 1