要在 windows 下偵錯 cocos h5 跟 mac 不一樣
首先安裝weinre
$ npm install -g weinre
啟動weinre
$ weinre --boundHost 192.168.3.162 --httpPort 9091
查看remote debug, 開啟這個頁面
http://192.168.3.162:9091/client/
iphone chrome的基本信息
element也可以查看network 如下
查看console輸出
這樣在手機上要找問題就方便多了
cocos打包h5版本之後, 在輸出的 web-mobile/index.html 檔案新增以下內容
<script src="http://192.168.3.162:9091/target/target-script-min.js"></script>
留言
張貼留言