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").
So the question is: is there any command to get sdcard directory directly from adb, without access to Android code?
Or maybe I can start activity with adb's am start, and get return value? Is this possible?
EDIT: Found the solution:
adb shell echo $EXTERNAL_STORAGE