从C#在Android上阅读的logcat [英] Reading logcat on android from c#

查看:669
本文介绍了从C#在Android上阅读的logcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待到做一个C#程序,将在logcat的输出从Android设备中读取到C#程序读取。

I am looking into making a c# program that will read in the logcat output from an android device and read it in to the c# program.

起初,而手机连接,它不应该要求在手机上的特定的应用程序被安装在C#程序能够检索logcat的输出就应该这样做。另外,手机不应该需要root权限。

Initially it should do this while the phone is connected and it shouldn't require a specific app on the phone to be installed for the c# program to be able to retrieve the logcat output. Also the phone shouldn't require root access.

这是不是这是可能的,我无法找到在谷歌任何表示,其可能的,但认为我会问就在这里,万一有人有一些有用的信息。

Is this something that is possible, I can't find anything on Google that says its possible but thought I'd ask on here in case someone has some useful information.

感谢您的帮助,您可以提供

Thanks for any help you can provide

推荐答案

最实际的答案是从你的C#程序执行shell命令亚行logcat并捕获它​​的输出。

The most practical answer is to execute the shell command 'adb logcat' from your C# program and capture its output.

该设备的唯一要求是USB调试在设置菜单中启用。

The only requirement for the device is that USB debugging be enabled in the settings menu.

该主机将要求安装该设备的Andr​​oid开发者工具和相应的USB驱动程序。这可以,遗憾的是会带来一些麻烦一笔可观的,尤其是发现对于Windows主机正确的驱动程序。

The host PC will require that the android developer tools and appropriate USB driver for the device be installed. This can, unfortunately involve a substantial amount of hassle, especially finding the right drivers for windows hosts.

更复杂的方法是复制的亚行程序的功能(它是开源的)和/或USB驱动程序在你的程序,或者安装与它们发送给你读日志权限设备上的应用程序 - 甚至是运行应用程序的用户ID下的SSH服务器,因此您可以连接并获得它们。

More complicated approaches would be to duplicate the functionality of the adb program (it is open source) and/or USB driver in your program, or to install an app on the device with the read logs permission which sends them to you - or even run an ssh server under the app userid so you can connect in and obtain them.

这篇关于从C#在Android上阅读的logcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆