Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting IOS console from Capacitor

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.

like image 685
Darrow Hartman Avatar asked May 31 '26 04:05

Darrow Hartman


1 Answers

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.

like image 58
Ben Racicot Avatar answered Jun 02 '26 18:06

Ben Racicot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!