用cordova打包web项目

用cordova打包web项目

这里是将web项目打包成apkhtml

1. 建立一个cordova项目并添加android platform

参考建立cordova项目(android platform)并在android_studio运行android

2. 修改config.xml

有两个config.xml要改:web

  • 一个是android平台下的platforms/android/res/xml/config.xml编辑器

  • 另外一个是项目根目录上的config.xml,用android_studio看不到,得用其它的编辑器
    在这里插入图片描述svg

  1. 将config.xml内的<content src="index.html" />的src改为项目地址.net

  2. 添加白名单,在config.xml内添加code

    <allow-navigation href="http://*/*" />
    <allow-navigation href="https://*/*" />
3. 将这个cordova项目打包或者用android_studio打开,而后在模拟器上能够看到

好比我放入csdn博客的连接https://blog.csdn.net/kikyou_csdn后打包能够看到
在这里插入图片描述orm