Bug 16546 - Console.Write() / Console.WriteLine() not working when debugging against device
Summary: Console.Write() / Console.WriteLine() not working when debugging against device
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: Debugger ()
Version: 7.0.4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-12-02 16:07 UTC by Joshua Barker
Modified: 2013-12-02 17:04 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Joshua Barker 2013-12-02 16:07:50 UTC
When running my code within the Simulator, all calls to Console.Write() / Console.WriteLine() emit the correct text to the Application Output window.  However, when deploying-to and debugging-against my iOS device (iPad Mini, iOS v. 7.0.4), nothing is emitted, even though this used to work previously.

Here is an example of the output I see when debugging against simulator:
------------------------------------------------------------------------
Starting iOS simulator 7.0
Launching application
Application launched. PID = 9088
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll [External]
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll [External]
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.dll [External]
Thread started:  #2
Loaded assembly: /Users/Morkoth/Projects/Dervish/Dervish/bin/iPhoneSimulator/Debug/Dervish.exe
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll [External]
Resolved pending breakpoint at '/Users/Morkoth/Projects/Dervish/Dervish/Classes/Metronome.cs:77,1' to void Dervish.Classes.Metronome.Start () [0x0004b].
2013-12-02 15:05:23.432 Dervish[9088:80b] Thread 1 - AppDelegate - OnActivated called, App is active.
2013-12-02 15:05:23.436 Dervish[9088:80b] Thread 1 - DervishViewController - Handling Application State Change: Active
2013-12-02 15:05:23.462 Dervish[9088:80b] Thread 1 - AppDelegate - Initializing AVAudioSession on Main Thread...
2013-12-02 15:05:23.465 Dervish[9088:80b] --
2013-12-02 15:05:23.467 Dervish[9088:80b] Thread 1 - Audio Session - Category: AVAudioSessionCategoryPlayback
2013-12-02 15:05:23.469 Dervish[9088:80b] Thread 1 - Audio Session - Category Options: 0
2013-12-02 15:05:23.473 Dervish[9088:80b] Thread 1 - Audio Session - IO Buffer: 0.02
2013-12-02 15:05:23.474 Dervish[9088:80b] Thread 1 - Audio Session - Mode: AVAudioSessionModeDefault
2013-12-02 15:05:23.475 Dervish[9088:80b] Thread 1 - Audio Session - Other Audio Is Playing: False
2013-12-02 15:05:23.476 Dervish[9088:80b] Thread 1 - Audio Session - Output Latency: 0.00999999977648258
2013-12-02 15:05:23.476 Dervish[9088:80b] Thread 1 - Audio Session - Output Channel Count: 2
2013-12-02 15:05:23.477 Dervish[9088:80b] Thread 1 - Audio Session - Output Volume: 1
2013-12-02 15:05:23.477 Dervish[9088:80b] Thread 1 - Audio Session - Sample Rate: 44100
2013-12-02 15:05:23.478 Dervish[9088:80b] --
2013-12-02 15:05:23.481 Dervish[9088:80b] Thread 1 - AppDelegate - Initializing MidiSystem on Main Thread...
2013-12-02 15:05:24.496 Dervish[9088:80b] Thread 1 - MidiSystem - Virtual Endpoint Created...
2013-12-02 15:05:24.497 Dervish[9088:80b] --
2013-12-02 15:05:24.499 Dervish[9088:80b] Thread 1 - Dervish Virtual Midi Endpoint
2013-12-02 15:05:24.499 Dervish[9088:80b] Thread 1 - Display Name: Dervish Virtual Midi
2013-12-02 15:05:24.500 Dervish[9088:80b] Thread 1 - Driver Owner: 
2013-12-02 15:05:24.500 Dervish[9088:80b] Thread 1 - Endpoint Name: Endpoint from Lookup
2013-12-02 15:05:24.503 Dervish[9088:80b] Thread 1 - IsNetworkSession: False
2013-12-02 15:05:24.504 Dervish[9088:80b] Thread 1 - Manufacturer: 
2013-12-02 15:05:24.505 Dervish[9088:80b] Thread 1 - MaxSysExSpeed: 3125
2013-12-02 15:05:24.506 Dervish[9088:80b] --
2013-12-02 15:05:24.747 Dervish[9088:80b] Thread 1 - MidiSystem - SetupChanged


And here is all I see when debugging against my device:

Please ensure your device is connected...
Connected to: Joshua's iPad
Launching /private/var/mobile/Applications/2D6DED31-7454-4B1C-9C53-14A79ADD6AAC/Dervish.app -debugtrack -monodevelop-port 10000 -connection-mode usb
Comment 1 Sebastien Pouliot 2013-12-02 16:32:43 UTC
It works fine for me.

* Could this be project specific ? e.g. if you try to run a template project with a simple C.WL inside it ?

* Can you try to reboot your device ? (i.e. the logging service could be stuck)

* Could you have some native libraries that redirect (or close) stdout ?
Comment 2 Joshua Barker 2013-12-02 17:04:20 UTC
It must have been the logging service.  I had tried deleting / re-deploying my app, but I did not think to reboot the device.  After restarting, the logging now works!

Maybe this should be added to the Xamarin Troubleshooting page? It might be helpful / useful to someone else in the future.

http://docs.xamarin.com/guides/ios/troubleshooting/