按照以下链接中的步骤,我成功地在 windows phone 8 上部署了一个 sencha touch 应用程序:
Deploy Sencha touch app on Windows Phone
我在安装 Git 后使用以下命令添加了我需要的插件,并将其设置为在 windows 的命令提示符下可用:
cordova plugin add <URL_GIT_REPO>
我没有使用包文件,而是使用了命令:
sencha app build native
我使用了在路径 SenchaTouchAppFolder/build/native/AppName 中创建的 app.js 和 app.json 文件
还做了以下事情:我必须获得一个开发者帐户,并在安装 visual studio 2012 express 和 windows phone SDK 8 后检查设备。
在设备上以Debug模式部署应用时,可以在Visual Studio的输出窗口中查看异常信息。
首先确保项目包含 app.json 文件。例如,在输出窗口中构建解决方案应显示以下消息:
1> Adding www\app.json
在csproj文件中应包含以下元素:
<Content Include = "www\app.json" />
<Content Include = "www\resources\sample\data.json" />
我还修改了以下代码行,以从 cordovalib/XHRHelper.cs 文件的本地存储中添加对模型所需的 JSON 响应的支持。
var funk = function () {
window.__onXHRLocalCallback = function (responseCode, responseText) {
alias.status = responseCode;
if (responseCode == '200') {
alias.responseText = responseText;
try {
JSON.parse(responseText);
} catch (e) {
Object.defineProperty(alias, 'responseXML', {
get: function () {
return new DOMParser().parseFromString(this.responseText, 'text/xml');
}
});
}
Object.defineProperty(alias, 'responseJSON', {
get: function () {
return new DOMParser().parseFromString(this.responseText, 'text/json');
}
});
}else {
alias.onerror && alias.onerror(responseCode);
}
一个有用的调试css错误的工具是仿真工具internet explorer 11
F12 > Emulation > Explorer Profile > Windows Phone
这个工具也很有用:Remote HTML5 debugging on Windows Phone with weinre