使用 ADB 查找 Android 设备的 Environment.getExternalStorageDirectory 的位置?

发布于 2024-11-18 06:17:31 字数 179 浏览 4 评论 0原文

有没有办法使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

段念尘 2024-11-25 06:17:31

现在,如果您找不到更好的解决方案,您可能可以只使用“/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.

灰色世界里的红玫瑰 2024-11-25 06:17:31

'adb shell "echo $EXTERNAL_STORAGE"' 是您一直在寻找的吗?

is 'adb shell "echo $EXTERNAL_STORAGE"' what you have been looking for?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文