我正在尝试简单地计算Android设备上一个目录中的文件数。我通过Windows10命令提示符使用adb shell。像find、wc、tree和tail这样的实用程序似乎不起作用,例如:
`tree . | tail -1`给出
`tmp-mksh: tree: not found`
`tmp-mksh: tail: not found`我可以写一些java来做这件事,但那太傻了:)有什么想法吗?
发布于 2018-10-02 01:21:40
尝试以下操作:
$ adb shell
generic_x86:/ $ cd yourDirectory
generic_x86:/yourDirectory $ ls | wc -l例如,在模拟器中:
$ adb shell
generic_x86:/ $ cd sdcard
generic_x86:/sdcard $ ls | wc -l
10编辑:
对于设备,您可以尝试:
$ adb shell
generic_x86:/ $ cd yourDirectory
generic_x86:/yourDirectory $ ls -l | grep . -chttps://stackoverflow.com/questions/52595733
复制相似问题