console.log working in Chrome but not on iPhone via Safari



  • This is weird.

    If I run:
    quasar dev -m spa

    I get console.log entries to output in the Chrome inspector (along with errors, etc.).

    But if I run:
    quasar dev -m capacitor -T ios

    with my iPhone connected to my Mac and wired up to Safari via the Develop menu, I get the console inspector window in Safari to appear for each page in my app that I load, but I don’t get any output in the console area of the Safari inspector.

    It’s very perplexing. Anyone know why I’m getting this result?



  • @omgwalt

    what if you and run android/capacitor with chrome inspector?

    Maybe this will help:
    https://capacitorjs.com/docs/apis/console



  • @dobbel Thanks for the suggestions. If I use Android Emulator with Chrome Inspector, I can see entries in console.log.

    I tried deleting the src-capacitor folder to see if that would help, but I’m still not seeing entries in console.log with the ios/safari inspect setup.

    I took a look at capacitor.config.json per your other suggestion. There is no “hide logs” setting. The only params listed are for: appID, appName, bundledWebRuntime, npmclient, and webDir.



  • @dobbel Oh, wait! I see what’s happening. Safari is popping up an additional JSContext inspector for my app every time I click a page or a control. The main inspector for the app gets hidden as a result. All I had to do was to uncheck “Automatically Show Web Inspector for JSContexts” in Safari under Develop > Simulator, and the issue went away.

    Hopefully this will help someone else who runs into a similar issue at some point in time.


Log in to reply