3
votes

I'm on phonegap 3.7 and I'm trying to launch the emulator via:

phonegap run wp8

But if fails with:

Error: Invalid target device specified.

[..]

ERROR: Error code -2147024809 for command: C:\Program Files (x86)\Microsoft SDKs \Windows Phone\v8.0\Tools\Xap Deployment\XapDeployCmd.exe with args: /installlau nch,C:/Users/kitsunde/Development/pub_pure_app/src/platforms/wp8/Bin/debug/Cordo vaAppProj_Debug_AnyCPU.xap,/targetdevice:xd

Error: C:\Users\kitsunde\Development\pub_pure_app\src\platforms\wp8\cordova\run. bat: Command failed with exit code 2 at ChildProcess.whenDone (C:\Users\kitsunde\AppData\Roaming\npm\node_modules \phonegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.j s:135:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:766:16) at Process.ChildProcess._handle.onexit (child_process.js:833:5)

What could be causing that?

3

3 Answers

6
votes

As of Cordova/PhoneGap 3.6, if you are trying to emulate Windows Phone 8.1, you have to use the windows platform in Cordova/PhoneGap rather than the wp8 platform.

phonegap platforms rm wp8
phonegap platforms add windows

The Apache Cordova 3.6 release has been inspired by the idea of Building universal Windows apps. It introduces a new unified ‘windows’ platform to build apps targeting Windows 8.0, Windows 8.1 and Windows Phone 8.1. Note, Windows Phone 8.0 still remains as a separate ‘wp8’ platform due to different implementation.

from: http://akvelon.com/apache-cordova-adds-windows-8-1-and-windows-phone-8-1-universal-apps-support/

Got that?

  • Windows 8 > use windows platform
  • Windows 8.1 > use windows platform
  • Windows Phone 8 > use wp8 platform
  • Windows Phone 8.1 > use windows platform

If you really just want to emulate Windows Phone 8, you probably need to install the Windows Phone 8 sdk if you haven't already.

0
votes

It seem the run wp8 command does not specify the target model of the emulator. You can navigate to platforms/wp8 folder and open the solution file (.sln file).

Then you can run your project with a emulator model, which you want.

0
votes

Here's a workaround and also to fix the issue you could have a look at this.

Cordova/PhoneGap cannot add WP7/WP8/Windows platform