您的位置:首页 > 其它

Get sdcard directory by adb

2013-12-10 18:52 148 查看
解决方案:
adb shell echo $EXTERNAL_STORAGE


I am making an application, which pulls files(Saved by android app) from the device sdcard by adb. The problem is that different devices, have various sdcard directories

i.e:

sdcard

sdcard/external_sd

Firstly I invented following solution:

run adb shell

ls

Check if dir "sdcard" exists

If yes run sdcard/ ls and check if external_sd exists

return value.

But the problem is that I have two samsung devices
GT-I9100
and
GT-I9000
and both have a directory
sdcard/external_sd
. When I am checking
System.getenv("EXTERNAL_STORAGE")
one returns
sdcard
and another
sdcard/external_sd
. I need to pull file which was previously saved to
System.getenv("EXTERNAL_STORAGE")
.

EDIT: Found the solution:

adb shell echo $EXTERNAL_STORAGE


原文连接:http://stackoverflow.com/questions/9374628/get-sdcard-directory-by-adb
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: