Missing print() output in Xcode

Previously, print() logs in a separate app’s window of Xcode worked well. Now the following (an example) no longer works:

print ("newRecordName is: (self.newRecordName)") print ("newPassword is: (self.newPassword)") print ("newUserName is: (self.newUsername)") print () print ("8. viewDidLoad()") print ()

The debug area is empty. I found no way to display the print output. Thanks for any help. Gerhard

Have you asked to display the Console ?

The buttons at bottom right of Xcode window should be like this (blue):

If the rightmost is black, click on it ; that will display the Console where logs are printed.

Note: You should also format code more properly with code formatter tool (<>):

print ("newRecordName is: (self.newRecordName)") 
print ("newPassword is: (self.newPassword)") 
print ("newUserName is: (self.newUsername)") 
print () 
print ("8. viewDidLoad()") 
print ()

You should at least see some text, but not the values, because syntax is wrong. Correct is:

print ("newRecordName is: \(self.newRecordName)") 

or simply:

print ("newRecordName is:", self.newRecordName) 

Hello Claude31, thanks for your answer.

  1. The buttons at bottom right of Xcode window should be like this (blue) Both are blue.
  2. Sorry about my wrong citation you monitored: print ("newRecordName is: (self.newRecordName)") That's a write error. In my app the syntax is correct: print ("newRecordName is: (self.newRecordName)")
  3. Some more info may help: The logs of print(…) should appear in a separate window of Xcode. This worked well about 2 or 3 weeks ago. I haven't changed anything. Perhaps an update - but I am not sure. Anyway. Here are some version infos:
  4. Versions: macOS 11.6 / iOS 15.2 / Xcode version 13.2.1 / iPhone Xr / iMac Circumstance: the iPhone is attached to the iMac for feedback of an app that runs on the iPhone.
  5. The Xcode window looks like this:

Best regards Gerhard

Same problem. Xcode 13.2, Swift 5.5.2. Debugger output appears fine, using "Log Message" in a breakpoint. But neither print() nor debugPrint() nor dump() writes to console.

I tested on MacOS 11.6.2, Xcode 13.2.1, iPhone XS 14.8. I tested even with Scheme set to Release and Debug Executable off.

  • I get all the print in the Report Navigator window
  • I also get them in the console.

So there is something strange.

Does it work when using Simulator ?

Could you try to replace one print statement by Swift.print()

Note

print ("newRecordName is: (self.newRecordName)")

will not print the content of self.newRecordName ; need

print ("newRecordName is: \(self.newRecordName)")
Missing print() output in Xcode
 
 
Q