离子windows-cordova在模拟器中运行windows通用应用程序

时间:2016-03-03 10:23:34

标签: windows cordova ionic-framework

我正在尝试在 Windows 10模拟器中部署离子应用程序

我添加了 Windows平台

我已将windows-target-version设置为10.0,方法是将此标记添加到应用程序的 config.xml 文件中。

  <platform name="windows">
      <preference name="windows-target-version" value="10.0" />
  </platform>

我正在使用Windows 10,并且我已正确安装 Windows 10 SDK

当我通过运行C:\Users\YBoukhata\labs\ap1>cordova run windows -- --phone定位模拟器时,会出现此错误

ERROR running one or more of the platforms: TypeError: Cannot read property '__ip' of undefined
You may not have the required environment or OS to run this project

对于我的详细信息,这里是完整的控制台消息

C:\Users\yacine\labs\ap1>cordova run windows  -- --phone
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\yacine\labs\ap1\hooks\after_prepare\010_add_platform_class.js C:\Users\yacine\labs\ap1
add to body class: platform-windows
Building project: C:\Users\yacine\labs\ap1\platforms\windows\CordovaApp.Windows10.jsproj
        Configuration : debug
        Platform      : anycpu
  CordovaApp.Windows10 -> C:\Users\yacine\labs\ap1\platforms\windows\AppPackages\CordovaApp.Windows10_0.0.1.0_anycpu_debug_Test\CordovaApp.Windows10_0.0.1.0_anycpu_debug.
  appx
Deploying windows10 package to device:
C:\Users\yacine\labs\ap1\platforms\windows\AppPackages\CordovaApp.Windows10_0.0.1.0_anycpu_debug_Test\CordovaApp.Windows10_0.0.1.0_anycpu_debug.appx
Attempting to remove previously installed application...
ERROR running one or more of the platforms: TypeError: Cannot read property '__ip' of undefined
You may not have the required environment or OS to run this project

已安装的仿真器

C:\Users\yacine\labs\ap1>cordova run windows --list
Available windows devices:
0. Device (device)
Available windows virtual devices:
1. Emulator 10.0.1.0 WVGA 4 inch 512MB (emulator)
2. Emulator 10.0.1.0 WVGA 4 inch 1GB (emulator)
3. Emulator 10.0.1.0 WXGA 4.5 inch 1GB (emulator)
4. Emulator 10.0.1.0 720p 5 inch 1GB (emulator)
5. Emulator 10.0.1.0 1080p 6 inch 2GB (emulator)

任何帮助?

谢谢

1 个答案:

答案 0 :(得分:0)

通过调试 windows cordova插件,我意识到Windows 10中的仿真还不支持。默认情况下,它会在设备中启动部署。

当我在选项参数中强制模拟时,我收到此警告

Windows 10 Phone emulator is currently not supported. 
If you want to deploy to emulator, please use Visual Studio instead.

Attempting to deploy to device...