Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23371] Remove placeholder device when detecting emulators #49

Closed

Conversation

garymathews
Copy link

@garymathews garymathews commented Jul 18, 2016

  • Remove placeholder Device``udid: 0 when nativeEnumerate only detects emulators
  • Supported devices should be detected with the wptool
  • Prevents a device always showing when one is not connected
Which device do you want to install your app on?
   1)  Device                    (udid: 0)    # this placeholder is not needed
   2)  Lumia 930 (RM-1045)       (udid: 00000015-4e57-1877-0000-000000000000)
   3)  Nokia Lumia 520 (RM-914)  (udid: 004a0090-40df-0094-0000-000000000000)
Select by number or name [Device]: 

JIRA Ticket

@cb1kenobi
Copy link
Contributor

I don't believe we can/should do this. By removing 8.0, Titanium Windows Hybrid will no longer work. windowslib is a library. It should be able to detect and handle WP SDK 8.0.

If this is being removed for the sake of the Titanium Windows build system, then the Titanium Windows build should enforce the minimum WP SDK, not windowslib.

@garymathews garymathews changed the title [TIMOB-23371] Remove 8.0 as a supported SDK [TIMOB-23371] Remove placeholder device when detecting emulators Jul 19, 2016
@garymathews
Copy link
Author

Updated PR to solve the issue without removing 8.0 SDK support.

@@ -260,7 +260,7 @@ function nativeEnumerate(wpsdk, options, next) {
} else {
var emulators = parseAppDeployCmdListing(out, wpsdk);
next(null, {
devices: [{name: 'Device', udid: 0, index: 0, wpsdk: null}],
devices: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now if I do windowslib.device.detect(), it will return an empty array?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if no devices are connected. Otherwise it will return any devices that have been detected by winAppDeployCmdEnumerate and wptool

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe so with newer versions of WP SDK, but the older WP SDK would always return a "device" entry regardless if there weren't any connected devices or if there were more than one.

The list of emulators also included the "device" entry and it was/is always present. I'm guessing we filter it out, but then were manually setting it for device.detect().

I will need to look into this further.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I just verified that we can't do this. If you only have WP SDK 8.1 installed, then the following code:

var windowslib = require('./index');

windowslib.device.detect(function (err, results) {
    if (err) {
        console.error('ERROR', err);
    } else {
        console.info(results);
    }
});

outputs:

{ devices: [], issues: [] }

This is not correct.

Older versions of Windows Phone SDK are not able to detect if a device is connected and so it always reports a device. We must continue to do the same.

I installed the Windows 10 RTM and it lists a Windows mobile device as expected, however the uuid is not compatible when installing using the WP SDK 8.1 and older tooling.

I correct thing to do is to combine "legacy" devices from older WP SDKs with real devices from new WP SDKs. So, if we detect WP SDK 8.1 or older, then we have to inject this pseudo device entry. If we detect Windows 10 RTM or newer, then add the real devices. The legacy device name should be renamed from Device to Window Phone 8.x Device or something.

The correct output when Windows Phone SDK 8 and Windows 10 RTM are installed should be:

{ devices:
   [ { name: 'Device', udid: 0, index: 0, version: '6.3', wpsdk: '8.1' },
     { name: 'Lumia 1520 (RM-940)',
       udid: '00000015-ba33-30a8-0000-000000000000',
       index: 0,
       wpsdk: null,
       ip: '127.0.0.1' } ],
  issues: [] }

@garymathews
Copy link
Author

@garymathews garymathews closed this Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants