Flutter Quick Tip: Print() statements from Swift code

Rob Jones
1 min readMay 3, 2024

--

If you are looking to print something in your Flutter project from Swift (such as when using a Notification Service Extension on iOS), you may find that the statements do not print to the console. Here is how you can view your print statements for Swift in iOS:

  1. Open your Flutter project
  2. Open the iOS Simulator
  3. Open the Console app
  • Finder -> Applications -> Utilities -> Console.app

4. In the Console app, select your iOS Simulator Device and then press “Start Streaming”

Select your device and then “Start Streaming”

5. To print something to this console from your Swift code, type:

  • NSLog(“Print me”)

6. Go to the Console app and look for your statement.

It’s a good idea to use the “Search” bar in the console to filter out all the noise. You will likely want to filter by using your app’s name (e.g., com.YourDomain.YourApp) or add a filter word to the beginning of your print statement (e.g., NSLog(“LOG: Print me”) — then filter by “LOG:”

That’s it for now — good luck.

--

--

Rob Jones
Rob Jones

Written by Rob Jones

Programmer/Generalist/Intraday Algo Trader

No responses yet