Description
When building for Windows and providing an invalid value for target, when selecting a target value that requires detecting devices (wp-emulator or wp-device) the CLI will error out with
C:\ProgramData\Titanium\mobilesdk\win32\6.2.0.v20170630062735\windows\cli\commands\_build\config\deviceID.js:76
throw new Error(
^
Error: No Windows Phone emulators found
at WindowsBuilder.<anonymous> (C:\ProgramData\Titanium\mobilesdk\win32\6.2.0.v20170630062735\windows\cli\commands\_build\config\deviceID.js:76:11)
at CLI.<anonymous> (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\lib\cli.js:838:9)
at C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:4053:5
at process (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:2479:17)
at Immediate.<anonymous> (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:2292:16)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)
---------------------------------------------
at C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:2291:9
at apply (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:41:25)
at C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:76:12
at _insert (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:2400:9)
at Object.push (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:2447:13)
at C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\lib\cli.js:925:9
at Array.forEach (native)
at CLI.prompt (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\lib\cli.js:924:43)
at CLI.<anonymous> (C:\Users\ewan\AppData\Roaming\npm\node_modules\titanium\lib\cli.js:640:13)
Steps to reproduce
Build a Windows app with ti build -p windows -T notvalid
Select either wp-device
or wp-emulator
Actual
CLI will error out with the above
Expected
CLI should not error out, should build as normal
PR: https://github.com/appcelerator/titanium_mobile_windows/pull/1033
Verified in SDK Version 6.2.0.v20170808012225 and 7.0.0.v20170808071205 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1033