Cordova 熱更新處理(二):在 IOS 調試過程

## 20170116 繼續處理 熱更新
    一、保險起見,從新 add ios 平臺
        sudo cordova platform remove ios
        sudo cordova platform add ios
    二、用 Xcode 打開 platforms/ios 目錄下的 .xcodeproj
        ** 先 將該目錄設置爲 可讀寫,以避免權限衝突
        ** 爲了調試方便,先確認 console 插件是否已經安裝
    三、直接 copy 當前 www 目錄到  http://192.168.1.103/hot20170113/www
        ** 第一次看到的 log 應該會是 chcp_nothingToUpdate,由於內容徹底相同
        2017-01-19 15:36:58.531 HelloCordova[2388:75721] nativeCallback  aaaa msg ===
        2017-01-19 15:36:58.532 HelloCordova[2388:75721] {"error":{"description":"Nothing to update","code":2},"action":"chcp_nothingToUpdate","data":{"config":{"release":"2017.01.17-15.01.16","content_url":"http:\/\/192.168.1.103\/hot20170113\/www","update":"resume","ios_identifier":""}}}
        2017-01-19 15:36:58.532 HelloCordova[2388:75721] processMessageFromNative  bbbb msg===
        2017-01-19 15:36:58.533 HelloCordova[2388:75721] {"error":{"description":"Nothing to update","code":2},"action":"chcp_nothingToUpdate","data":{"config":{"release":"2017.01.17-15.01.16","content_url":"http:\/\/192.168.1.103\/hot20170113\/www","update":"resume","ios_identifier":""}}}
    四、修改一下 index.html,再次在模擬器上運行
          sudo cordova-hcp build
          copy 到 http://192.168.1.103/hot20170113/www
    五、直接在 模擬器 - gardware -- Home ,再次打開程序,沒有反應
         ** 由於 app 直接從後臺 挑起,因此,仍是剛纔的進程
         ** 實際運行中,app 須要加上一個 退出
    六、從 Xcode 從新運行,注意觀察 log
         ** 找到新版本,並準備安裝 chcp_updateIsReadyToInstall 
          2017-01-19 15:56:51.480 HelloCordova[2647:85036] nativeCallback  aaaa msg ===
          2017-01-19 15:56:51.480 HelloCordova[2647:85036] {"action":"chcp_updateIsReadyToInstall","data":{"config":{"release":"2017.01.19-15.51.12","content_url":"http:\/\/192.168.1.103\/hot20170113\/www","update":"resume","ios_identifier":""}}}
          2017-01-19 15:56:51.481 HelloCordova[2647:85036] processMessageFromNative  bbbb msg===
          2017-01-19 15:56:51.482 HelloCordova[2647:85036] {"action":"chcp_updateIsReadyToInstall","data":{"config":{"release":"2017.01.19-15.51.12","content_url":"http:\/\/192.168.1.103\/hot20170113\/www","update":"resume","ios_identifier":""}}}
          ** 看到這個,就應該是安裝了
          2017-01-19 15:56:51.484 HelloCordova[2647:85036] broadcastEventFromNative  6666 nativeMessage.action==
          2017-01-19 15:56:51.485 HelloCordova[2647:85036] chcp_updateIsReadyToInstall
    七、仍是從 xcode 挺住、運行 app
        ** 首頁面目一新了,哈哈哈!
相關文章
相關標籤/搜索