更新 appmanifest 功能,来自 cordova 插件的视觉元素 windows 10

Update appmanifest capabilities, visual elements from cordova plugin windows 10

我需要使用 cmd 行通过 cordova 插件为 windows 10 个应用程序更新 package.appmanifest。 下面是我在 plugin.xml 中的代码片段,它应该更新 appmanifest 但不起作用。

  <config-file target="package.appxmanifest" parent="/Package/Capabilities">

     <DeviceCapability Name="webcam"/>
     <DeviceCapability Name="microphone"/>

</config-file>

Windows version: 4.4.3

Cordova version: 6.4.0

另外请告诉我如何更改应用程序图标?我试过跟随,但还是不行。

 <config-file target="package.appxmanifest" parent="/Package/Applications/Application">

  <uap:VisualElements
    DisplayName="MyApp"
    Description="My description"
    BackgroundColor="#464646"
    Square150x150Logo="images\Square150x150Logo.png"
    Square44x44Logo="images\Square44x44Logo.png">

    <uap:SplashScreen Image="images\splashscreen.png" />
    <uap:DefaultTile ShortName="MyAppName"
                     Square310x310Logo="images\Square310x310Logo.png"
                     Square71x71Logo="images\Square71x71Logo.png"
                     Wide310x150Logo="images\Wide310x150Logo.png" />

  </uap:VisualElements>
</config-file>

更新:

我也尝试过将目标设置为 target="package.windows10.appxmanifest" 但这也没有用。

I need to update package.appmanifest for windows 10 app via cordova plugin using cmd line. Below is my code snippet in plugin.xml that should update the appmanifest but doesn't work.

请确保您在正确的位置添加了config-file

plugin.xml的例子:

<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
       id="cordova-plugin-test"
  version="1.0.0">
<name>TestPlugin</name>
<description>Cordova Test Plugin</description>
<license>Apache 2.0</license>


<!-- windows -->
<platform name="windows">
    <config-file target="package.appxmanifest" parent="/Package/Capabilities">
        <Capability Name="picturesLibrary" />
        <DeviceCapability Name="webcam" />
    </config-file>
</platform>

</plugin>

注意:构建完成后,您可以在platforms\windows\package.appxmanifest中查看结果。

Also please let me know how to change app icons?

要更改应用图标,请参考Customize app icons