[Resolved] How to view "print()" output on Mac when building for Xcode Simulator??

Hi,

I do not own a Mac, so I use the cloud-based Macincloud service for my iOS builds.

I’m using newMapView for the first time, and my app is crashing when loaded onto my iOS device.

As newMapView isn’t supported in the Corona Simulator, I am having difficulty finding the exact part of my code which is causing the crash, so I’ve included a large number of “print()” statements so I can follow the execution of the code.

However, I cannot work out how to get access to this “print()” output on the cloud-based Mac.

According to the Corona Weekly FAQ (http://www.coronalabs.com/blog/2012/04/18/faq-wednesday/), I need to build for the Xcode simulator, and run the Mac Console app to see the print output.

But I can’t find any reference to the Console app on the Mac.
Has anyone else come across a similar issue on Macincloud? Or can you suggest anything else to try to be able to see the “print()” output? [import]uid: 60457 topic_id: 29843 reply_id: 329843[/import]

on my Mac, Console is located in Applications. Did you try doing a search in spotlight for Console? [import]uid: 122310 topic_id: 29843 reply_id: 119674[/import]

Hi Trumaj,

Using Print() to get console data is a bit tricky (even without going through macincloud). I have not used MacInCloud, but I can walk you through the steps necessary to get it working on a normal mac.

  1. Whenever you use a print() statement in code, follow it up with an io.flush(). This will ensure that the output is sent to the console when you want it (and not when the console feels like printing it).
  2. Build the source for device.
  3. Open The organizer through XCode. (Window->Organizer)
  4. Install the application on your device.
  5. Open the application on your device while you have the organizer open and your device still connected.
  6. Click on the Console tab on the left. (It is underneath your device on the left panel).

You should now be able to see all the system events as well as your custom print statements.

I hope this helps. Let me know if you get stuck on any of the steps. If this doesn’t work, your best bet would be to create a log file, and write all your print statements to that file. You can then get the log file from the device by clicking on the “Applications” tab in the organizer and selecting your application.

Regards,
Brian Reinhart
Vellum Interactive [import]uid: 158289 topic_id: 29843 reply_id: 119680[/import]

Hi,

Thanks for the advice, guys.

I think that the people at Macincloud have removed access to the Mac Console, presumably for security reasons? I have a support ticket in with them about this, so I will see what they say.

I do not own a Mac (I’m a Windows geek), hence me using the Mac cloud solution. Unfortunately, doing things via the cloud, I cannot connect my local device to the cloud-based Mac, so I’m not able to do any of things you suggested.

What I did in the end was anything but elegant, but I created a text object in the middle of the screen which I updated with the “print()” text. It did the trick, and my bug(s) are now resolved.

Thanks you for you advice anyway. It was a great learning experience :slight_smile:

[import]uid: 60457 topic_id: 29843 reply_id: 119683[/import]

on my Mac, Console is located in Applications. Did you try doing a search in spotlight for Console? [import]uid: 122310 topic_id: 29843 reply_id: 119674[/import]

Hi Trumaj,

Using Print() to get console data is a bit tricky (even without going through macincloud). I have not used MacInCloud, but I can walk you through the steps necessary to get it working on a normal mac.

  1. Whenever you use a print() statement in code, follow it up with an io.flush(). This will ensure that the output is sent to the console when you want it (and not when the console feels like printing it).
  2. Build the source for device.
  3. Open The organizer through XCode. (Window->Organizer)
  4. Install the application on your device.
  5. Open the application on your device while you have the organizer open and your device still connected.
  6. Click on the Console tab on the left. (It is underneath your device on the left panel).

You should now be able to see all the system events as well as your custom print statements.

I hope this helps. Let me know if you get stuck on any of the steps. If this doesn’t work, your best bet would be to create a log file, and write all your print statements to that file. You can then get the log file from the device by clicking on the “Applications” tab in the organizer and selecting your application.

Regards,
Brian Reinhart
Vellum Interactive [import]uid: 158289 topic_id: 29843 reply_id: 119680[/import]

Hi,

Thanks for the advice, guys.

I think that the people at Macincloud have removed access to the Mac Console, presumably for security reasons? I have a support ticket in with them about this, so I will see what they say.

I do not own a Mac (I’m a Windows geek), hence me using the Mac cloud solution. Unfortunately, doing things via the cloud, I cannot connect my local device to the cloud-based Mac, so I’m not able to do any of things you suggested.

What I did in the end was anything but elegant, but I created a text object in the middle of the screen which I updated with the “print()” text. It did the trick, and my bug(s) are now resolved.

Thanks you for you advice anyway. It was a great learning experience :slight_smile:

[import]uid: 60457 topic_id: 29843 reply_id: 119683[/import]