歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android開發教程:向模擬器的sdcard中添加文件

Android開發教程:向模擬器的sdcard中添加文件

日期:2017/3/1 10:36:51   编辑:Linux編程

向模擬器的sdcard中添加文件有兩種方法:

1.在eclipse的DDMS視圖中操作

啟動eclipse---打開DDMS視圖---選擇File Explorer,出現下面的窗口

650) this.width=650;">

選中sdcard文件夾---點擊650) this.width=650;">,選擇你需要添加的文件就可以了

2.運用adb命令操作

先將要添加的文件放到platform-tools(我的platform-tools路徑 D:\Android\android-sdk-windows\platform-tools)文件夾下,之後在命令行窗口進入 D:\Android\android-sdk-windows\platform-tools,輸入adb命令添加文件,如下圖所示:

650) this.width=650;" height=85>

這時,文件music.mp3就被添加到sdcard/Android目錄下面

650) this.width=650;">

之後可以在模擬器中打開dev tools,運行Media Scanner,在音樂中播放添加的音樂

還可以在命令行運行adb shell來查看sdcard中的文件,如下圖所示:

650) this.width=650;" height=301>

Copyright © Linux教程網 All Rights Reserved