appcelerator-archive / windowslib

This is a library of utilities for dealing programmatically with Windows Phone applications, used namely for tools like Titanium.
http://www.appcelerator.com
Other
4 stars 10 forks source link

[TIMOB-23279] Only report a device when one has been detected #42

Closed garymathews closed 8 years ago

garymathews commented 8 years ago

JIRA Ticket

infosia commented 8 years ago

@garymathews

I still see following device that doesn't have udid. It's supposed to be removed, right?

    {
      "name": "Device",
      "udid": 0,
      "index": 0,
      "wpsdk": null
    },

test code

windowslib.device.detect(function (err, results) {
    console.log(JSON.stringify(results,null,2));
});

result

{
  "devices": [
    {
      "name": "Device",
      "udid": 0,
      "index": 0,
      "wpsdk": null
    },
    {
      "name": "Windows 10 Mobile Device",
      "udid": "00000015-cxxf-8a24-0000-000000000000",
      "index": 0,
      "wpsdk": null,
      "ip": "127.0.0.1"
    },
    {
      "name": "Lumia 630 Dual SIM (RM-978)",
      "udid": "00000015-4xx1-3x2b-0000-000000000000",
      "index": 1,
      "wpsdk": null,
      "ip": "127.0.0.1"
    }
  ],
  "issues": []
}
garymathews commented 8 years ago

Yes, that's correct. Currently, it will always detect that placeholder device. Even when no devices are plugged in. So removing it would correctly report that no devices are connected.

garymathews commented 8 years ago

Updated PR - resolved conflicts