How am I able to push .txt files to the emulator using Android Studio?
11 Answers
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; see toggle in screenshot)

- 4,519
- 3
- 23
- 18
-
1can't find - "Enable Clipboard Sharing". where is it on macbook? – Shirish Herwade Jan 22 '19 at 12:21
-
12The /sdcard/Download folder is still empty after file upload. – alex351 Apr 10 '19 at 11:28
-
3I found the folder I copied in Download of internal storage and not the sdcard. – Santosh May 22 '19 at 06:25
-
Drag and Drop from Desktop to Emulator which is running the app. Then go to device explorer to verify. – DragonFire Apr 17 '21 at 02:57
-
I had to run Android Emulator with --writable-system for this to work `emulator -avd
-writable-system` – Rain Jun 18 '21 at 13:21 -
If your file is on the Desktop in Ubuntu don't drag and drop directly from the Desktop but open ~/Desktop in the UI files window on Ubuntu and then drag and drop. – Kartik Watwani Jul 16 '21 at 13:32
-
as simple as that – schlenger Nov 17 '21 at 13:40
-
Please be more specific about where to find the clipboard sharing setting. – default123 Jul 25 '23 at 20:59
Update (May 2020): Android studio have new tool called Device File Explorer. You can access it in two way:
- By clicking on
Device File Explorer
icon in right bottom corner of android studio window. - If you could not find its icon, inside Android Studio press shift button twice. Quick search window will appear, then type
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.

- 9,825
- 16
- 72
- 145
-
This worked for the copy logic. However - using AS-ide 2.3 - in DDMS, the /mnt/sdcard will not appear as an expandable folder and appears as *empty* - even after restarting DDMS. I verified the copy command worked when using `adb shell` to navigate to that folder. Thank you for pointer to solution – Gene Bo May 15 '17 at 18:51
-
1Also you may select a folder, then right click and choose "Upload...", then select a path to a source folder or file. – CoolMind Feb 21 '18 at 17:04
-
-
11
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.

- 10,926
- 9
- 65
- 108
-
1Is there any way to do this using Android studio like how we used to do in Eclipse.@shifar – Girish May 25 '15 at 09:02
-
-
-
yes, Android Device Monitor opens new window similar to the Eclipse DDMS – Girish May 25 '15 at 09:40
-
On Android Studio, when creating a new emulator, be sure to specify lie 1GB for external memory – Someone Somewhere Dec 25 '15 at 16:08
-
This worked, but it certainly isn't the whole story when pulling a single file. When using `adb pull` the destination path has to be a relative path on Windows. Absolute paths don't seem to work. – NightOwl888 Nov 30 '20 at 22:16
Android Device monitor is no longer available in android studio.
If you are using android studio 3.0 and above.
- Go to "Device File Explorer" which is on the bottom right of android studio.
- If you have more than one device connected, select the device you want from the drop-down list on top.
mnt>sdcard
is the location for SD card on the emulator.- Right click on the folder and click Upload. See the image below.
Note: You can upload folder as well not just individual files.
-
This. I saved my file in the `sdcard/Download` folder, then in the Emulator's file chooser application, use the Hamburger Menu and select the Downloads folder. – lukegjpotter May 01 '18 at 10:34
-
2i put the files into sdcard/Download but emulators file picker shows nothing – Rafael Lima May 07 '18 at 21:15
-
3It doesn't work. storage/emulated/ path is where we need to put our files but it says "Permission denied". – Darush Sep 18 '18 at 12:15
I am using Android Studio 3.3.
Go to View -> Tools Window -> Device File Explorer. Or you can find it on the Bottom Right corner of the Android Studio.
If the Emulator is running, the Device File Explorer will display the File structure on Emulator Storage.
Here you can right click on a Folder and select "Upload" to place the file
I usually use mnt - sdcard - download folder. Thanks.

- 1
- 1

- 648
- 7
- 14
-
Each Android version has a different folder can you tell us about each version like 30, 29, 28, 27, 26... that will be useful information – DragonFire Apr 17 '21 at 03:24
Open command prompt and give the platform-tools path of the sdk. Eg:- C:\Android\sdk\platform-tools> Then type 'adb push' command like below,
C:\Android\sdk\platform-tools>adb push C:\MyFiles\fileName.txt /sdcard/fileName.txt
This command push the file to the root folder of the emulator.

- 1,049
- 12
- 12
After you drag and drop your files from Desktop to Emulator like this answer here : https://stackoverflow.com/a/44885506/3904109
Your location of files will be
Android 19, 21, 22 /storage/sdcard/Download
Android 23, 24, 25, 26, 27, 28, 29, 30 /storage/emulated/0/Download

- 3,722
- 2
- 38
- 51
refer johnml1135
answer, but not fully work.
after self investigate, using official docs, it works now:
and use Drag and Drop
actually worked, but use android self installed app Download
, then you can NOT find the copied file, for not exist so called /sdcard/Download
folder.
finally using other file manager app, like
then can see the really path is
/storage/emulated/0/Download/
which contains the copied files, like
/storage/emulated/0/Download/chenhongyu_lixiangsanxun.mp3
after drag and drop more mp3 files:

- 4,555
- 31
- 31
- 45

- 12,947
- 1
- 71
- 56
-
Excellent! I used the filepath `/storage/emulated/0/Downloads` and it worked right away. – Kyle Burkett Apr 08 '20 at 16:14
on windows 10 , android studio emulator.
be on the directory yourFile.xml is.
on terminal, command:
adb push yourFile.xml \C:\Users\yourUN\.android\avd\Pixel_4_API_29.avd\mnt\sdcard
Pixel_4_API_29 is the emulator name , choose the device you are using on emulator

- 409
- 6
- 8