LoginSignup
1
6

More than 5 years have passed since last update.

Androidエミュレータにローカルマシンのファイルをコピーする方法

Posted at

テストなどでエミュレータにファイルを配置したい場合のコマンドです。
エミュレータ内に単にadb pushしても内容がすぐに反映されない場合があるので、adb push後に強制的にメディアスキャンを発生させます。

# adb push <ローカルファイルパス> <リモートファイルパス>
adb push ~/Documents/test.jpg /storage/Download/

# メディアスキャンを発生させて新しいファイルをインデックスさせる
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard
1
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
6