2017-07-19 13 views
0

我需要通過cordova插件使用cmd行更新Windows 10應用程序的package.appmanifest。 下面是我在plugin.xml中的代碼片斷,它應該更新appmanifest,但不起作用。更新appmanifest功能,來自cordova插件窗口的視覺元素10

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

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

</config-file> 

Windows版本:4.4.3

科爾多瓦版本: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> 

更新:

我也試圖與把目標作爲目標= 「package.windows10.appxmanifest」,並且也沒有工作。

回答

1

我需要通過cordova插件使用cmd行更新Windows 10應用程序的package.appmanifest。下面是我在plugin.xml中的代碼片段,它應該更新appmanifest,但不起作用。

請確保你已經在正確的地方加入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檢查結果。

也請讓我知道如何更改應用程序圖標?

要更改應用程序圖標,請參閱Customize app icons

+0

嗨,Elvis Xia,我在正確的位置配置了文件。但是我的appxmanifest文件仍然沒有更新。我在platform \ windows \裏有package.windows.appxmanifest,package.phone.appxmanifest和package.windows10.appxmanifest,但沒有package.appxmanifest。我錯過了什麼嗎? –

+1

這些文件是正確的,奇怪的是清單文件沒有更新。你能否檢查插件是否正確添加,並在''config.xml'文件中引用,例如'' –

+0

是的插件已安裝。在config.xml中,它就像: '' –