欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

Get sdcard directory by adb

发布时间:2025/3/8 编程问答 47 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Get sdcard directory by adb 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

 

解决方案: 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 toSystem.getenv("EXTERNAL_STORAGE").

     

     

     

    EDIT: Found the solution:

    adb shell echo $EXTERNAL_STORAGE

     

    原文连接:http://stackoverflow.com/questions/9374628/get-sdcard-directory-by-adb 

    转载于:https://www.cnblogs.com/08shiyan/p/3468019.html

    总结

    以上是生活随笔为你收集整理的Get sdcard directory by adb的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。