這篇文章給大家分享的是有關EgretWing鏈接微信開發工具調試問題的示例分析的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。
開發過程中會遇到工具配置錯誤。
這就需要在EgretWing中的配置文件launch.json重新配置工具路徑。
創建Egret項目debugTest [Egret 2D 項目向導]

創建項目完成,在.wing文件夾下launch.json配置debug信息。
如上圖:
{
"version": "0.2.0",
"configurations": [
{
"name": "Wing 內置播放器調試",
"type": "chrome",
"request": "launch",
"file": "index.html",
"runtimeExecutable": "${execPath}",
"useBuildInServer": true,
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"preLaunchTask":"build",
"port":5610
},
{
"name": "使用本機 Chrome 調試",
"type": "chrome",
"request": "launch",
"file": "index.html",
"runtimeExecutable": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"useBuildInServer": true,
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"preLaunchTask":"build",
"port":5610
},
{
"name": "附加到 Chrome 進程",
"type": "chrome",
"request": "attach",
"port": 9222,
"webRoot": "${workspaceRoot}"
}
]}點擊調試如下圖:

launch.json 介紹
name 配置名稱; 顯示在啟動配置的下拉列表。Wing 內置播放器調試 、使用本機 Chrome 調試、附加到 Chrome 進程。
type EgretWing配置類型,chrome、node、extensionHost。
request 配置的Request類型。 有效值為 "launch" 或者 "attach"。
file debug 入口文件,在瀏覽器打開的html文件。
runtimeExecutable 可執行文件的絕對路徑。默認值是 PATH 上的運行時可執行文件。改成您的 Chrome 安裝路徑 例如 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe 或 /Applications/Google Chrome.app/Contents/MacOS/Google Chrome。
useBuildInServer 當為true, EgretWing 將啟動一個內建的web server。
sourceMaps 是否使用 JavaScript 源映射(如果存在)。
webRoot Web服務的根目錄。
preLaunchTask 執行任務之前運行的任務。
port web服務器指定的端口號。
操作演示如下:

感謝各位的閱讀!關于“EgretWing鏈接微信開發工具調試問題的示例分析”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。