I'm working with Cordova on a SurfacePro 4 to build & deploy Win10 (UWP) apps. I have Visual Studio 2015 installed and the Win 10 SDK and can successfully deploy my apps to the SurfacePro using the Cordova command line via:
cordova run windows
I have a Lumia 550 Windows 10 phone connected via USB to the SurfacePro and have enabled Developer Mode, Device discovery and Device Portal (without Authentication) on the phone in the Settings under "For Developers".
I can deploy to this phone by opening the CordovaApp.sln file generated by Cordova in Visual Studio, selecting ARM and deploying to the attached device. It works well.
However, it doesn't work when I try to deploy to the device directly from the Cordova command line.
When I run the following command:
cordova run windows --list
I get this output (no devices found):
Available windows devices:
Available windows virtual devices:
However, when I run this command:
WinAppDeployCmd devices
I get this output (my phone is found):
127.0.0.1 <GUID removed> Graeme-s-Windows-phone
If I use this name in my Cordova command line:
cordova run windows --target="Graeme-s-Windows-phone" --arch="arm" -- --phone
It ultimately reports an error:
Deploying windows10 package to Graeme-s-Windows-phone:
Error: Specified device not found
I've tried various other command line options, but to no avail.
Anyone know why Cordova doesn't recognise my attached phone?
My question was answered by Vladimir Kotikov on the Cordova issue board as follows:
We currently list windows phone 8.1 devices/emulators by default. To list windows 10 devices you'll need to add --win10 options to cordova run --list command, like this:
cordova run --list -- --win10 (notice double dash after --list)
Also to deploy app to win10 phone you can use this command
cordova run windows --device -- --appx uap --archs arm --phone
which doesn't require any knowledge about conected device's name