How can I get console.log output from my mobile ON the mobile device?

后端 未结 3 747
挽巷
挽巷 2021-02-05 07:51

I do a lot of my dev work from mobile devices. Is there a way to get js access to console.log output from within a mobile browser?

3条回答
  •  礼貌的吻别
    2021-02-05 08:01

    For Android - I found this works:

    1. Open Android Studio IDE
    2. Connecting the device in debug mode
    3. Open logcat
    4. Run the browser UI on android device - to see the console log output

    Here's a few console.log() lines from logcat:

    [INFO:CONSOLE(18)] "100 - checking FUNC PARAM ... ", source: https://somewhere/util/message_util.js (18)

    [INFO:CONSOLE(18)] "101 - > ENTER: AppAuth.onHasAuthFunc", source: https://somewhere/util/message_util.js (18)

    Idea to try this approach, thanks to @Marcus's answer , suggesting:

    " 'hook into' the native console "

    ~~~~~~

    Also, saw other posts suggesting to type: about:debug

    .. into the address bar of device browser. Not sure if that had anything to do with getting the connection to work

提交回复
热议问题