我希望我的主要html文件具有與我的項目不同的名稱。IBM Worklight 5.0.x - 更改主HTML文件名
我發現如果我不使用相同的名稱,Worklight將不會重新連接。我已經嘗試更改application-descriptor.xml中的mainFile標記並更改iOS上worklight.plist中的wlMainFile條目。
直接更新不起作用。更重要的是,應用程序不會重新連接,並且我得到一個灰色屏幕(可能是因爲iOS試圖使用錯誤的文件啓動)。
例如:
Project name: MyProject
main file: home.html
application-descriptor.xml: <mainFile>home.html</mainFile>
worklight.plist: <wlMainFile>home.html</wlMainFile>
上面不起作用。
[編輯後加入我的應用descriptor.xml]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Licensed Materials - Property of IBM
5725-G92 (C) Copyright IBM Corp. 2006, 2012. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp. -->
<!-- Attribute "id" must be identical to application folder name -->
<application xmlns="http://www.worklight.com/application-descriptor" id="agent" platformVersion="5.0.6">
<displayName>My app</displayName>
<description>My application description </description>
<author>
<name>Redacted</name>
<email>[email protected]</email>
<homepage>http://redacted.com</homepage>
<copyright>(c) redacted LLC</copyright>
</author>
<height>748</height>
<width>1024</width>
<mainFile>home.html</mainFile>
<thumbnailImage>common/images/ipad-app-icon.png</thumbnailImage>
<!-- -->
<ipad bundleId="com.redacted.myproject" version="1.0">
<worklightSettings include="true"/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
</security>
</ipad>
<!-- -->
<android version="1.0">
<worklightSettings include="true"/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
<publicSigningKey>Replace this text with the public key of the certificate with which you sign the APK.
For details see the Worklight Developer's Reference Guide.</publicSigningKey>
</security>
</android>
<worklightServerRootURL>http://${local.IPAddress}:8080</worklightServerRootURL>
</application>
所以,要清楚,如果我遇到了一個問題,我的mainFile比項目名稱以外的名稱。 Worklight並不總是調用mainfile指定的文件名,特別是在初次使用應用程序之後。
感謝您回覆@Idan Adar。我徹底仔細檢查。我沒有提到你提到的其他任何文件(主CSS文件,主JavaScript文件)中的主HTML文件。我改變了application-descriptor.xml中各個地方的文件名,文件名本身(顯然)以及worklight.plist(iOS版)。 – user2217751
在worklight.plist中改變它沒有意義,文件的內容是在編譯時生成的,所以需要關注其他文件。我的意思是,你想改變我提到的所有相同的名稱。用你的application-descriptor.xml編輯你的問題。 –
確保在更改文件名和引用之後重新構建項目。並使用更新後生成的Xcode項目在您的設備上運行。 –