使用 ADB 查找 Android 设备的 Environment.getExternalStorageDirectory 的位置?
有没有办法使用 ADB 来了解特定插入设备将为 Environment.getExternalStorageDirectory 返回的位置?
我想将一个文件推送到那里,然后从设备上运行的活动中读取该文件。我认为这条路径可能会根据设备的不同而有所不同,我将不得不在许多不同的 Android 设备上运行它。
谢谢!
Is there a way using ADB to know the location of what a specific plugged in device will return for Environment.getExternalStorageDirectory ?
I would like to push a file there and then read this file from the activity running on the device. I think this path can vary based on device, and I will have to run this on numerous different android devices.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
现在,如果您找不到更好的解决方案,您可能可以只使用“/sdcard”。
它在 Android 源。
For now you could probably get away with just using "/sdcard" in case you don't find a better solution.
It's defined pretty static in the Android source.
'adb shell "echo $EXTERNAL_STORAGE"' 是您一直在寻找的吗?
is 'adb shell "echo $EXTERNAL_STORAGE"' what you have been looking for?