To work with an emulator or device's file system: In the Devices tab, select the emulator that you want to view the file system for. To copy a file from the device, locate the file in the File Explorer and click the Pull file button. To copy a file to the device, click the Push file button on the File Explorer tab.
To copy a file from the connected emulator/device onto the computer, use the following command: adb.exe pull /data/app/<filename> c:\ NOTE When using the adb.exe utility to pull or push files from or into the emulator, ensure that only one AVD is running.
One easy way is to drag and drop. It will copy files to /sdcard/Download. You can copy whole folders or multiple files. Make sure that "Enable Clipboard Sharing" is enabled. (under ...->Settings)
Update (May 2020): Android studio have new tool called Device File Explorer. You can access it in two way:
Device File Explorer
icon in right bottom corner of android studio window.Device File
in it and Device File Explorer will appear in search result and you can click it.
Then you can navigate to folder which you want to push your file in it. Right click on that folder and select upload(or press Ctrl+Shift+O). Select file you want to upload and it will upload file to desired location.
Push file using adb.exe
:
In Android 6.0+, you should use same process but your android application cannot access files which pushed inside SDCARD using DDMS File Explorer. It is the same if you try commands like this:
adb push myfile.txt /mnt/sdcard/myfile.txt
If you face EACCES (Permission denied)
exception when you try to read file inside your application, it means you have no access to files inside external storage, since it requires a dangerous permission.
For this situation, you need to request granting access manually using new permission system in Android 6.0 and upper version. For details you can have a look in android tutorial and this link.
Solution for old android studio version:
If you want to do it using graphical interface you can follow this inside android studio menus:
Tools --> Android --> Android Device Monitor
Afterward, Android Device Monitor(DDMS) window will open and you can upload files using File Explorer. You can select an address like /mnt/sdcard
and then push your file into sdcard.
You can use the ADB via a terminal to pass the file From Desktop to Emulator.
adb push <file-source-local> <file-destination-remote>
You can also copy file from emulator to Desktop
adb pull <file-source-remote> <file-destination-local>
How ever you can also use the Android Device Monitor to access files. Click on the Android Icon which can be found in the toolbar itself. It'll take few seconds to load. Once it's loaded, you can see a tab named "File Explorer". Now you can pull/push files from there.
Android Device monitor is no longer available in android studio.
If you are using android studio 3.0 and above.
mnt>sdcard
is the location for SD card on the emulator. Note: You can upload folder as well not just individual files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With