Getting IOS console from Capacitor
Asked Answered
S

1

8

Does anyone know how to view console.log() from the Xcode simulator using capacitor? I am aware that you can view the system logs via iOS Simulator > Menu Bar > Debug > Open System Log (How can I get the console logs from the iOS Simulator?), but this does not show any of the console.logs when using capacitor to run an ios application.

Stadiometer answered 7/8, 2021 at 23:40 Comment(3)
open safari go to devtoolParsee
Do you mean the website devtool or an feature in safari called devtool? Because I don't see anything native to safari that's called devtool. There is a tab in safari called "develop", if that's what you mean. Would you mind elaborating @NajamUsSaqib?Stadiometer
Check this: ionicframework.com/docs/troubleshooting/…Parsee
W
1

I couldn't get the Ionic instructions to give any output via Safari's dev tools.

However, Capacitor's solution is its built-in Console API https://capacitorjs.com/docs/v2/apis/console

The Console API automatically sends console.debug, console.error, console.info, console.log, console.trace and console.warn calls to the native log system on each respective platform. This enables, for example, console.log calls to be rendered in the Xcode and Android Studio log windows.

I was able to see the logs in Xcode's logging as long as the build isnt broken in some way.

Wording answered 24/1, 2023 at 19:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.