我用的是HBuilder工具,可視化更便捷,目前我這操作的apk包是不需要上架的,所以跟實際需要上架的可能還有些出入
- 首先先新建個項目,選擇5+App模式
- 把目前需要打包的內容上傳到服務器,我們以嵌套的形式進行打包,找到index.html,增加代碼
<!DOCTYPE html>
<html><head><meta charset="utf-8"><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /></head><style>body {margin: 0;}</style><body><iframe id="app_iframe" src="https://www.baidu.com" width="100%"scrolling="no" frameborder="0" allowfullscreen></iframe></body><script>var screenHeight = screen.height;var element = document.getElementById('app_iframe');element.setAttribute('height', screenHeight + 'px');</script>
</html>
可以點擊右上角先預覽看是否可正常訪問
- 點擊
“發行”=》“App-Android/iOS-云打包”
,彈窗按照如圖所示操作點擊打包即可
manifest.json可以進行對應APP設置,同時這個云打包每天免費次數只有五次哦,所以需要謹慎使用~