简体   繁体   English

如何使用Android模拟器设备在Visual Studio(Xamarin)中访问调试日志?

[英]How can I reach debug log in Visual Studio (Xamarin), with Android emulator devices?

I am newbie in mobile development, but I've already made C# desktop applications. 我是移动开发的新手,但我已经制作了C#桌面应用程序。 I try to make mobile apps, but unfortunately I can't reach Device log because of this: https://ibb.co/59bzp4L 我尝试制作移动应用,但遗憾的是我因此而无法访问设备日志: https//ibb.co/59bzp4L

I don't have devices in my device log, therefore I can't see the error messages etc... I really don't know, how can I log my messages on Xamarin, I read an article about that, but if I can't reach my android emulator devices, I can't debugging. 我的设备日志中没有设备,因此我看不到错误消息等...我真的不知道,我怎么能在Xamarin上记录我的消息,我读了一篇关于它的文章,但如果我无法到达我的android模拟器设备,我无法调试。 Any suggestion? 有什么建议吗?

So again, I read this article, and I understood: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows 所以,我再次读到这篇文章,我明白了: https//docs.microsoft.com/en-us/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows

But I don't have any devices in my device log, as you see on the picture. 但是我在设备日志中没有任何设备,如图所示。

C#, Visual Studio 2017, Xamarin, Android_Accelerated_x86_oreo (Android 8,1 - Api 27) C#,Visual Studio 2017,Xamarin,Android_Accelerated_x86_oreo(Android 8,1 - Api 27)

Have you tried clicking the play button in the logcat/device log window? 您是否尝试过单击logcat /设备日志窗口中的播放按钮? I assume the emulation is working fine but you can't get logs out? 我假设仿真工作正常,但你不能得到注销? Try playing the logcat and use breakpoints in the code to slowly step through and see if you get any errors. 尝试播放logcat并在代码中使用断点慢慢单步执行,看看是否有任何错误。

You might also need ADB drivers. 您可能还需要ADB驱动程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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