ubuntu下挂载android sdcard的方法

挂载SDCAED的方法包括以下几步:

  1. 到SDK目录

cd ~/android/tools

  1. 创建一个sdcard镜像

mksdcard 2147483648~/mysdcard/sdcard.img

  1. 挂载镜像

sudo losetup /dev/loop0~/mysdcard/sdcard.img

(source:http://www.osdev.org/osfaq2/inde … ges%20Under%20Linux)

  1. 创建一个目录, 用来挂载镜像

mkdir ~/mysdcard/sdcard

  1. 挂载设备到这个镜像目录, 这样就能直接往这个目录里面放文件了

sudo mount /dev/loop0~/mysdcard/sdcard

最后,在模拟器中加载这个sdcard

emulator -sdcard~/mysdcard/sdcard.img

如果你使用eclipse, 可以修改启动配置

Run >RunConfigurations>Target - Additional Emulator Comand Line Options

-sdcard~/mysdcard/sdcard.img

操作SDCAED

adb push - copyfile/dir to device

adb pull - copyfile/dir from device