cordova 热更新

1.根目录.chcpenv

{
  "content_url": "http://106.13.216.173:5636/hotpush",
  "config_url": "http://106.13.216.173:5636/hotpush/chcp.json"
}
// 线上
{
  "content_url": "https://app.xx.io",
  "config_url": "https://app.xx.io/chcp.json"
}

2.根目录.cordova-hcp.json

{
  "name": "alan",
  "ios_identifier": "",
  "android_identifier": "",
  "update": "resume",
  "content_url": "http://106.13.216.173:5636/hotpush"
}
// 线上
{
  "name": "xx",
  "ios_identifier": "",
  "android_identifier": "",
  "update": "start",
  "content_url": "https://app.xx.io"
}

3.根目录.config.xml

<chcp>
    <auto-download enabled="true" />
    <auto-install enabled="true" />
    <config-file url="http://106.13.216.173:5636/hotpush/chcp.json" />
    <native-interface version="1" />
</chcp>
// 线上
<chcp>
    <auto-download enabled="true" />
    <auto-install enabled="true" />
    <config-file url="https://app.xx.io/chcp.json" />
    <native-interface version="1" />
</chcp>

4.命令

cordova-hcp build

 

posted @ 2020-06-06 13:00  AlanTao  阅读(360)  评论(0编辑  收藏  举报