解决方案: 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:

  1. run adb shell
  2. ls
  3. Check if dir "sdcard" exists
  4. If yes run sdcard/ ls and check if external_sd exists
  5. 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

Get sdcard directory by adb的更多相关文章

  1. tools/adb: No such file or directory

    运行adb出现这种错误: bash: ./adb: No such file or directory   但adb确实存在.那说明你用的是64位的Linux,没装32位运行时库,安装 $ sudo  ...

  2. ubuntu 运行android sdk 下的工具adb报bash: ./adb: No such file or directory

    运行adb出现这种错误: bash: ./adb: No such file or directory   但adb确实存在. 可能1:你用的是64位的Linux,没装32位运行时库,安装 $ sud ...

  3. bash: ./adb: No such file or directory

    运行adb出现这种错误: bash: ./adb: No such file or directory   但adb确实存在. 可能1.你用的是64位的Linux,没装32位运行时库,安装 $ sud ...

  4. [Android Tips] 25. ADB Command Note

    copy from https://github.com/operando/Android-Command-Note Android Command Note Logcat adb logcat -v ...

  5. Android系统在超级终端下必会的命令大全(adb shell命令大全)

    . 显示系统中全部Android平台: android list targets . 显示系统中全部AVD(模拟器): android list avd . 创建AVD(模拟器): android c ...

  6. Android 手机 ADB FastBoot 命令基本用法

    adb用法: 准备: 1.在电脑上安装相应的USB驱动,在各分区置顶帖子有下载链接 2.手机进入设置->开发人员选项->勾选USB调试 adb devices 查看是否有设备 adb sh ...

  7. 使用 adb logcat 显示 Android 日志

    本文为转载.  地址:http://www.hanshuliang.com/?post=32 eclipse 自带的 LogCat 工具太垃圾了, 开始用 adb logcat 在终端查看日志; 1. ...

  8. Android 调试桥介绍 (adb)

    Android 调试桥 adb ( Android Debug Bridge)是一个通用命令行工具,其允许您与模拟器实例或连接的 Android 设备进行通信.它可为各种设备操作提供便利,如安装和调试 ...

  9. Appium自动化测试教程-自学网-adb命令

    adb命令: adb ( Android Debug Bridge)是一个通用命令行工具,其允许您与模拟器实例或连接的 Android 设备进行通信.它可为各种设备操作提供便利,如安装和调试应用. T ...

随机推荐

  1. 基于uploadify.js实现多文件上传和上传进度条的显示

    uploadify是JQuery的一个插件,主要实现文件的异步上传功能,可以自定义文件大小限制.文件类型.是否自动上传等属性,可以显示上传的进度条.官网地址是http://www.uploadify. ...

  2. 记一个界面刷新相关的Bug

    今天遇到一个比较有意思的bug, 这里简单记录下. Bug的症状是通过拖拉边框把我们客户端主窗口拖小之后,再最大化,会发现窗口显示有问题, 看起来像是刷新问题, 有些地方显示的不对了. 这里要说明的是 ...

  3. js模版引擎handlebars.js实用教程——each-基本循环使用方法

    返回目录 <!DOCTYPE html> <html> <head> <META http-equiv=Content-Type content=" ...

  4. ASP.NET Core: 全新的ASP.NET !

    背景 最新版本的 ASP.NET 叫做 ASP.NET Core (也被称为 ASP.NET 5)   它颠覆了过去的 ASP.NET. 什么是 ASP.NET Core? ASP.NET Core ...

  5. underscore源码阅读记录

    这几天有大神推荐读underscore源码,趁着项目测试的空白时间,看了一下. 整个underscore包括了常用的工具函数,下面以1.3.3源码为例分析一下. _.size = function(o ...

  6. JavaScript-分支语句练习

    -1.方程 ax^2+bx+c=0,一元二次方程求根情况. 解: <head><meta http-equiv="Content-Type" content=&q ...

  7. Nodejs·理解Buffer

    Node里面的Buffer其实就是用于网络请求.文件读取等等操作,而且是分配在堆外,不会占用堆内的内存,这也是因为本来V8的内存就很小,如果读取大文件,那就...... 之前有看过Logstash的B ...

  8. SSM 三大框架整合

    上一篇已经讲了整个各个子模块的创建过程以及它们之间的依存关系, 那么这一篇就来正式的整合三大框架(SSM)了. 1, 准备环境1.1 为每个War包工程创建一个Server 那么 添加了Server后 ...

  9. python学习 文件操作

    一.python打开文件 #=====================python 文件打开方式 open()===================== # open(fileName,type) t ...

  10. react6 事件传递参数

    <body><!-- React 真实 DOM 将会插入到这里 --><div id="example"></div> <!- ...