Debug webapps¶
大多數 web-devs 可能希望在通常的瀏覽器環境中進行大部分編碼和偵錯。 Ubuntu Touch 瀏覽器符合現代 Web 標準,大多數網路應用程式無需進一步更改即可執行。
對於那些需要進一步偵錯(希望)極少數情況,有兩種方法可以獲得有關故障的更多訊息。
觀看日誌¶
If you are comfortable in a CLI environment, most Javascript errors will leave an entry in the app log file:
.cache/upstart/application-click-[YOUR_APP_NAME.AUTHOR_NAME..].log
You can check the log file in the terminal or use the LogViewer app.
備註
Enable developer mode for debugging to keep logs until the next reboot. Without developer mode enabled, logs will get deleted after you close the app.
在瀏覽器中偵錯¶
預設的 Ubuntu Touch 瀏覽器基於 Blink 技術,該技術也用於 Chrome / Chromium。 通過以特殊模式啟動瀏覽器,您可以訪問常規的 Chrome 樣式偵錯器。
On your phone, start the browser in inspector mode::
export QTWEBENGINE_REMOTE_DEBUGGING=0.0.0.0:9221
morph-browser --desktop_file_hint=/usr/share/applications/morph-browser.desktop [web_site_url]
Now on your computer, launch Chrome/Chromium browser, and point address to http://YOUR_UT_IP_ADDRESS:9221