在BlackBerry模拟器或者真机上高效测试WebWorks/PhoneGap程序--不需要重新打包编译
来源:互联网 发布:仁化网络问政 编辑:程序博客网 时间:2024/05/19 13:17
正常情况下,在BlackBerry手机上面每次修改了html/javascript以后,你需要打包项目为zip文件,使用WebWorks SDK编译zip文件为cod文件,然后部署到模拟器或者真机(还需要签名)进行测试。
这个,在开发调试的时候,有点烦人了。其实有更好的办法,摆脱打包/编译/签名的繁琐重复劳动。方法如下:
1)把cod文件里面的各种html等资源文件放在SD卡上,或者放在一个测试Web服务器上面;
2)让WebWorks应用的启动页面指向到SD卡或者测试Web服务器的页面;
3)放开WebWorks的安全控制。
编辑config.xml文件,编辑如下两行:
<content src="file:///SDCard/myTestFolder/index.html"/> 或者是 <content src="http://mytestsite.com/index.html" />
<access subdomains="true" uri="*" />
参考:
Update your BlackBerry WebWorks application without Recompiling
======================================================================
下面是我的测试应用使用的config.xml(参考自bbUI项目和PhoneGap BlackBerry模块)。
注意其中黄色部分,分别是指定启动页面的URL,禁用WebWorks的cache功能(否则修改了html,但是WebWorks里面显示的还是老的页面,程序调试好以后要把cache再次打开),开放所有URL资源访问权限给WebWorks应用。
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright 2010-2011 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0">
<rim:navigation mode="focus" />
<name>WebWorksTDD Development</name>
<rim:loadingScreen backgroundImage="images\background.png" foregroundImage="images\hippo.png" onFirstLaunch="true">
<rim:transitionEffect type="fadeIn" />
</rim:loadingScreen>
<icon src="images\icon.png" />
<icon src="images\icon.png" rim:hover="true" />
<content src="http://shanghai.springworks.info/WebWorksTDD/index.html" />
<!-- bbUI API -->
<feature id="blackberry.push" />
<feature id="blackberry.message.sms" />
<feature id="blackberry.ui.menu" />
<feature id="blackberry.identity" />
<feature id="blackberry.system.event" />
<feature id="blackberry.app" />
<!-- PhoneGap API -->
<feature id="blackberry.system" required="true" version="1.0.0.0" />
<feature id="blackberry.find" required="true" version="1.0.0.0" />
<feature id="blackberry.identity" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
<feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
<feature id="blackberry.io.file" required="true" version="1.0.0.0" />
<feature id="blackberry.utils" required="true" version="1.0.0.0" />
<feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
<feature id="blackberry.app" required="true" version="1.0.0.0" />
<feature id="blackberry.app.event" required="true" version="1.0.0.0" />
<feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
<feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/>
<feature id="blackberry.media.camera" />
<feature id="blackberry.ui.dialog" />
<rim:cache disableAllCache="true" />
<!-- PhoneGap API -->
<access subdomains="true" uri="file:///store/home" />
<access subdomains="true" uri="file:///SDCard" />
<!-- Expose access to all URIs, including the file and http protocols -->
<access subdomains="true" uri="*" />
<rim:permissions>
<rim:permit>use_camera</rim:permit>
<rim:permit>read_device_identifying_information</rim:permit>
<rim:permit>access_shared</rim:permit>
<rim:permit>read_geolocation</rim:permit>
</rim:permissions>
</widget>
======================================================================
测试中发现
1)用公网internet Web服务器,而且WebWorks禁用了cache,网络访问速度比较慢
2)用局域网intranet Web服务器,我的BlackBerry 9800是公司BES激活的,无法访问局域网Web服务器。解决办法:删除Service Book -- Desktop IPPP就不走MDS服务器,直接走WiFi访问局域网intranet Web服务器了。
- 在BlackBerry模拟器或者真机上高效测试WebWorks/PhoneGap程序--不需要重新打包编译
- BlackBerry WebWorks例子程序Weather在Ripple中编译错误
- 使用Ripple测试PhoneGap开发的BlackBerry程序
- 使用Ripple测试PhoneGap开发的BlackBerry程序
- 编译PlayBook WebWorks例子程序Aura
- 使用免费的Open NFC simulator模拟器在BlackBerry模拟器上进行NFC程序调试
- 使用免费的Open NFC simulator模拟器在BlackBerry模拟器上进行NFC程序调试
- 命令行下面创建Rhodes程序项目Hello World,编译并启动BlackBerry模拟器运行程序
- 模拟器中ramdisk.img或者recovery.img重新解压打包步骤。
- 一个hello程序的android内核模块编译方法及在模拟器中进行测试结论
- flume重新编译打包
- BlackBerry WebWorks应用例子:扫描条码barcode
- 重新打包第三方框架ZBarSDK静态库,同时支持真机与模拟器测试
- 在Android环境上测试第一个PhoneGap程序
- android 编译小结,模拟器打包~
- phonegap打包及libCordova.a编译问题
- 使用Eclipse新建phonegap程序,并打包
- iOS开发中测试机或者模拟器运行时程序没有占整个屏幕问题
- HBase之功能细节
- Keil uVision2 压缩编译后的程序大小
- GDI特效2
- Javascript 面向对象编程
- 计算机启动原理(X86机器)
- 在BlackBerry模拟器或者真机上高效测试WebWorks/PhoneGap程序--不需要重新打包编译
- hadoop作业调优参数整理及原理
- GDI特效3
- 再谈软件测试-工作感悟
- hadoop-eclipse-plugin 编译 打包
- oracle内置函数 wmsys.wm_concat使用
- Couldn't resolve error 的问题
- 删除SQL Server字段
- Android棋类游戏:五福