构建iOS混合应用程序不会更新worklight.plist或root.plist文件 [英] Building iOS hybrid app does not update worklight.plist or root.plist file
问题描述
我在macbook air(最新的OSX)上运行WL 6.1(6.1.0.01.20140310-1427)。我有一个dojo混合应用程序,我正在尝试连接到远程WL服务器。当我生成iOS应用程序并且我将worklight服务器的地址更改为远程服务器时。它不会更改生成的iOS代码中的地址。我遵循的步骤是:
I'm running WL 6.1 (6.1.0.01.20140310-1427) on a macbook air (latest OSX). I have a dojo hybrid application that I'm trying to connect to a remote WL server. When I generate an iOS app and I'm changing the address of the worklight server to a remote server. It does not change the address in the generated iOS code. The steps I follow are:
- 打开构建设置并部署目标.. 。在混合应用程序文件夹上。
- 选中构建应用程序以使用其他Worklight服务器的复选框。
- 放入新服务器信息并单击确定
- 构建所有环境
- 构建完成后,我启动到xcode并查看worklight.plist和Root.plist文件。
- Open the Build Settings and Deploy Target... On the hybrid app folder.
- Select the check box for Build the application to work with a different Worklight server.
- Put in the new server information and click OK
- Build all environments
- After the build is complete, I launch into xcode and look at the worklight.plist and Root.plist files.
此时它们仍然引用我的本地服务器。如果我编辑它们指向远程服务器,那么我的应用程序工作。由于每次进行构建时都会重新生成这些文件,因此这不是有效的解决方案。
At this point they are still referencing my local server. If I edit them to point to the remote server, then my app works. Since these files are regenerated every time you do a build this is not a valid solution.
要验证我的应用程序中没有任何内容,我创建了一个默认的dojo混合应用程序。执行上面列出的步骤。当我启动到xcode时,Root.plist和worklight.plist仍然有默认的本地服务器信息。
To verify it is nothing in my app, I created a default dojo hybrid application. Performed the steps I listed above. When I launched into xcode, the Root.plist and worklight.plist still have the default local server information.
所以这是有趣的事情。我还有一个运行相同级别的WL开发人员插件的win7系统。我执行相同的步骤,并在Windows上正确更新worklight.plist文件,而不是在osx中。唯一的另一个区别是win7版本正在运行jre 1.7_21,其中osx运行1.7_51。两者都处于64位模式。
So here is the funny thing. I also have a win7 system running the same level of WL developer plugin. I perform the same steps and the worklight.plist file is updated correctly on windows, just not in osx. The only other difference is the win7 version is running jre 1.7_21 where the osx is running 1.7_51. Both are in 64-bit mode.
推荐答案
我相信你的Mac和Windows机器之间的真正区别在于第5步,你在哪里发布到xcode。如果你的意思是你实际上在做Run As> Xcode项目,那么请看下面。此选项仅在Mac中可用,而不在Windows中。
I believe the real difference between your Mac and Windows machines is step 5, where you "launch into xcode". If by that you mean that you are actually doing Run As > Xcode project, then see below. This option is available only in Mac and not in Windows.
这是Worklight 6.0.0.x和6.1.0.x中的预期行为。
This is the expected behavior in Worklight 6.0.0.x and 6.1.0.x.
如果将服务器地址更改为远程服务器(而不是本地开发服务器)并构建,然后选择运行方式> Xcode项目,这将将服务器设置覆盖回本地开发服务器。
If after changing the server address to a remote server (rather than the local development server) and building, and then selecting Run As > Xcode project, this will overwrite the server settings back to the local development server.
运行方式> Xcode项目执行3个操作:
Run As > Xcode project does 3 actions:
- Build&将应用程序部署到本地 Worklight Development Server
- 生成Xcode项目(这反过来会覆盖worklight.plist以使用本地服务器设置)
- 在Xcode中打开生成的Xcode项目
- Build & deploy the app to the local Worklight Development Server
- Generate an Xcode project (this in turn overwrites worklight.plist back to use local server settings)
- Open the generated Xcode project in Xcode
因此,如果您想将该应用程序与远程服务器设置一起使用,然后在更改设置并构建应用程序后,:
So if you want to use the app with the remote server settings, then after changing the settings and build the app, either:
- 从your-iphone \ package文件夹中复制.zip
- 在文件系统中导航到iphone \ native文件夹,然后双击.xcodeproj文件直接在Xcode中打开它(比如Run As> Xcode项目)
对于Worklight的未来版本,正在考虑简化行为,以便无论您选择本地还是远程服务器设置,运行方式> Xcode项目将始终使用您选择的那些。
For future releases of Worklight it is being considered to streamline the behavior so that no matter if you choose, local or remote server settings, Run As > Xcode project will always use the ones you've selected.
这篇关于构建iOS混合应用程序不会更新worklight.plist或root.plist文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!