1. 创建SD文件
首先运行cmd,然后cd到你的android —sdk的tools目录下(前提需要在tools目录下新建一个mycard文件夹)
命令行方式: mksdcard -l sdcard 50M D:/android-sdk-windows/platform-tools/mysdcard/sdcard.img
mksdcard参数如下:
mksdcard: create a blank FAT32 image to be used with the Android emulator
usage: mksdcard [-l label] <size> <file>
if <size> is a simple integer, it specifies a size in bytes
if <size> is an integer followed by 'K', it specifies a size in KiB
if <size> is an integer followed by 'M', it specifies a size in MiB
2.在模拟器中加载刚创建的SD文件
1)命令行方式:emulator -avd avd2.3 -sdcard D:/android-sdk-windows/platform-tools/mysdcard/sdcard.img
2)eclipse 方式:(前提是安装了google android 插件), 选择菜单“Run” -> "Run Configurations..." ,进入弹出页面,选择"Targets"标签,在最下面一行"Aditional Emulator Command Line Options"下面增加启动参数 -sdcard d:/android/mysdcard/sdcard.img
3、sdcard中加入内容
adb.exe push E:Xunleigive.mp3 /sdcard/give.mp3
4、将sdcard内容拷贝至本地
adb.exe pull /sdcard/MyContacts/MyContacts.txt d:/