在android文件系统中深度搜索文本文件
我想在 Android 文件系统中搜索包含特定信息(例如,设备的电池电流和电压)的文本文件。
我尝试使用 Astro 文件浏览器,但它的搜索功能似乎不支持深度搜索(也在子目录中搜索)。
我还尝试使用 ADB 将我想要搜索的目录(/sys/ 目录)复制到我的电脑硬盘驱动器,但不幸的是,这不起作用,因为由于缺少读取访问权限,大多数文件都没有被复制。
您是否没有任何有效的解决方案来浏览文件系统(无论是从 PC 还是通过 Android 应用程序)?
I would like to search within the Android file system for finding text files containing specific information (e.g., the device's battery current and voltage).
I tried to use the Astro File Browser but it seems that its search functionality does not support deep search (search within children directories as well).
I also tried to copy the directory in which I would like to search (the /sys/ directory) to my PC's hard drive using ADB but unfortunately this doesn't work as most of the files aren't copied due to missing reading access.
Do you no any working solution to browse the file system (either from a PC or via an Android app)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
每个制造商将文件放在不同的位置(或者至少可以)。尝试使用 API 访问此信息:
有一个意图,ACTION_BATTERY_CHANGED
和 BatteryManager 类
至于浏览文件系统,Astro 工作得很好 - 但如果操作系统没有授予您权限,除非您 root 手机,否则您将无法读取它。
Each manufacturer puts files in different places (or at least can). Try using the API to access this information:
There is an intent, ACTION_BATTERY_CHANGED
And the BatteryManager class
As for browsing the file system, Astro works fine - but if the OS is not granting you permissions, you will not be able to read it unless you root your phone.
我现在实现了一个简单、愚蠢的 Java 方法,可以从 Eclipse ADT 执行以在文件系统中搜索,并且它可以工作(但是,速度很慢):
可以使用表示要搜索的根目录的文件对象来调用该方法(例如、new File("/")) 和表示要查找的文件名的字符串(例如,“电压”)。
I now implemented a simple, stupid Java method that can be executed from the Eclipse ADT to search in the file system and it works (however, slowly):
The method can be called using a file object representing the root directory to be searched (e.g., new File("/")) and a String representing file names to be found (e.g., "voltage").