简体   繁体   中英

Debug.WriteLine equivalent in MonoTouch/MonoDroid?

What's the equivalent to Debug.WriteLine for MonoTouch or MonoDroid?

Here's a guide for MonoDroid: http://monodroid.net/Documentation/Guides/Android_Debug_Log

For MonoTouch, Console.WriteLine will show up in MonoDevelop and in the logs from your iOS device.

For MonoDroid, you can use the Android.Util.Log class to log debug, info, errors etc that you can view from the Android Debug Bridge's logcat (adb logcat). An example would be something like this to log an info message : Android.Util.Log.Info("Barcode", "Scan button pressed.")

Mono for Android provides Debug.WriteLine() , as does MonoTouch, so I'm not sure why you need a workaround.

Debug.WriteLine() is visible within MonoDevelop (when debugging) and is also copied to the Android Debug Log with the mono-stdout tag. System.Console output is also copied to the Android Debug Log with the mono-stdout ( Console.Out ) and mono-stderr ( Console.Error ) tags.

您可以将System.Console.WriteLine与Monotouch和Monodroid一起用于调试输出。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM