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
Conversation
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. |
Updated PR to solve the issue without removing |
@@ -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: [], |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: [] }
Device``udid: 0
whennativeEnumerate
only detects emulatorswptool
JIRA Ticket