简体   繁体   English

通过Robotium测试项目从android应用读取日志

[英]Reading Log from android app through Robotium test project

I need to read the logs from the android application project through robotium test project. 我需要通过robotium测试项目从android应用程序项目中读取日志。 Please help me out. 请帮帮我。

Thanks 谢谢

If you want to see the logs , Please use logcat, in Eclipse(that comes with android SDK). 如果要查看日志,请在Eclipse(Android SDK随附)中使用logcat。

Go To: 去:

Window --> Show View --> other --> search LogCat 窗口->显示视图->其他->搜索LogCat

In LogCat you can see the logs for both Application under test and your test project. 在LogCat中,您可以看到被测应用程序和测试项目的日志。 To use android's inbuilt logging library , you can do something like Log.d ("I am a Log"); 要使用android的内置日志记录库,您可以执行Log.d ("I am a Log");类的Log.d ("I am a Log"); In LogCat you can filter your preferred logs by creating a filter by clicking on the + button there. 在LogCat中,您可以通过单击此处的+按钮创建过滤器来过滤您的首选日志。

If you want to wait for some log to appear or assert some log messages use the following methods: 如果要等待某些日志出现或断言某些日志消息,请使用以下方法:

solo.waitForLogMessage(String logMessage, int timeout);

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

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