|
本帖最后由 quwei 于 2015-2-25 18:21 编辑
楼主的方法很好。我iphone上调试,发现给的下载包过期了。按楼主的思路我自己写了一个,一个页面就可以了。公布 index.html 源代码如下,各位可以重新新建一个应用, index.html用下面的代码替换,编译安装到自己手机就可以了做云调试了。
截图
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
- <title>Hello APP</title>
- <link rel="stylesheet" type="text/css" href="./css/api.css" />
- <link rel="stylesheet" type="text/css" href="./css/common.css" />
-
- <!-- 新 Bootstrap 核心 CSS 文件 -->
- <link rel="stylesheet" href="http://cdn**.**/bootstrap/3.3.2/css/bootstrap.min.css">
- <style>
- #main { font-size:16px; line-height:150% }
- /*
- #URL { border-bottom:1px solid #ccc; }
- #submit { border: 1px solid #ccc; padding:5px;}
- */
- </style>
- </head>
- <body>
- <div id="wrap">
- <div id="header">
- <h1>云测试</h1>
- </div>
- <div id="main">
- <div class="container">
- <br />
- <form action="" method="POST" onsubmit="openw();return false" >
- <div class="form-group">
- <label for="URL">输入URL地址</label>
- <input type="text" class="form-control" id="URL" placeholder="输入URL" value="http://">
- </div>
- <button type="submit" class="btn btn-primary" style="padding-left:30px;padding-right:30px;">开始测试</button>
- <button type="button" onclick="clearcache()" class="btn btn-default">清除缓存</button>
- </form>
- </div>
-
-
- </div>
- <!--
- <div id="footer">
- <h5>Copyright ©2014 </h5>
- </div>
- -->
- </div>
- </body>
- <script type="text/javascript" src="./script/api.js"></script>
- <script type="text/javascript">
- function openw() {
- var url = document.getElementById('URL').value
- malert('正在打开:' + url );
-
- api.openWin({
- name: 'CloudAPPMain',
- url: url,
- reload: true
- });
-
- }
- function clearcache() {
- api.clearCache();
- malert('缓存清理成功。');
- }
- function malert(msg) {
- api.alert({
- title: "提示",
- msg: msg,
- buttons: ["确定"]
- });
- }
- apiready = function(){
- console.log("Hello APICloud");
- };
- </script>
- </html>
复制代码
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|