how to see my print/NSLog outputs when using Instruments Automation??

I'm new to Instruments, and I'm trying to use Instruments Automation to send location events to my Xcode Swift project, which uses MapKit.


I've got this working by:

- running my project in PROFILE mode in Xcode

- then going to instruments automation with a script that uses "setLocationWithOptions"


But neither in Xcode or Instruments do I see my normal log output (print or NSLog) I use to monitor the app? How would I see print line outputs when doing this? Or is the different approach I should be taking?

From your description, it sounds like you are launching your app from Xcode, and then trying to attach to it from Instruments? Instruments is only able to get the application's output if it launches it.


In any case, does Xcode's UI testing infrastructure work for you? Performing testing from within Xcode is the recommended approach.

Lauching from Instruments grzywacz. Need to use Instruments as this allows proper CLLocation/MKMapKit testing, allowing you to simulate altitude/speed etc, which you can't do within XCode (i.e. can only do lat/long here)

If there is something you are unable to accomplish using Xcode's UI testing, I highly recommend a radar so they can hear about your use case. I'm also unaware of any issues with NSLog()s failing to appear in Xcode or Instruments, so that sounds like another radar with more precise reproduction steps.

Forgive me if this is obvious, but: have you looked at Instrument's Console display? In the dividing bar between the tracks and the details, there's a "breadcrumb trail" some of whose segments are pop-up menus. In particular, the first segment should have an option to show the console output.

yes I had looked at the Instruments Console

Which version of Instruments are you using? And what version of OS X? I have seen an issue with failure to capture output with some versions, in some circumstances.


In Instruments, if you (re)visit the Choose Target dialog using the control in the toolbar, after selecting your app, below the table where you can enter environment variables, there's an action (gear) pop-up menu. On that menu, there's an option to control what happens to the process I/O. Make sure that's set how you want it before running the target.


Also, have you tried not launching your app with Xcode's Profile action and instead starting by launching Instruments, selecting the template, customizing it with whatever other instruments or options you want, choosing your app as the target, and running? Do you get the output then?


What if you use a different template, just for testing, such as Time Profiler? Does that capture output? If so, then it suggests there's something different about the Automation template.

Instruments - Version 7.3.1

OS X 10.11.5

(will need a bit more time to try your suggestions - thanks)

how to see my print/NSLog outputs when using Instruments Automation??
 
 
Q