Debug webapps

La maggior parte degli sviluppatori web sviluppa il codice ed esegue il debug con i browser più utilizzati. Il browser di Ubuntu Touch è conforme con gli standard più moderni, molte webapp funzioneranno senza ulteriori modifiche.

Per quei (speriamo) rari casi in cui è richiesto un debugging più approfondito, esistono due modi per ottenere ulteriori informazioni sul malfunzionamento.

Guardare i file di log

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.

Nota

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.

Esegui il debug nel browser

Il browser di default di Ubuntu Touch è basato sulla tecnologia Blink che è anche utilizzata dai browser Chrome/Chromium. Avviando il browser in una modalità speciale, avrai accesso al debug in stile 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]

Ora sul tuo computer, lancia il browser Chrome/Chromium, e punta all’indirizzo http://YOUR_UT_IP_ADDRESS:9221