question

AliBilalStudent-0330 avatar image
0 Votes"
AliBilalStudent-0330 asked LeonLu-MSFT commented

I am trying to add my textFile onto my android emulator in Visual Studio. Can anyone help on how to do so?

Working on an application. I have a text file created filled with data and am trying to get it onto the emulator to access it from the device. Anyone have any tips or know how to do so. Thanks in advance.

dotnet-android
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLu-MSFT avatar image
0 Votes"
LeonLu-MSFT answered LeonLu-MSFT commented

Hello,​

Welcome to our Microsoft Q&A platform!

First of all, please just only one android emulator. Then open Android Adb Command Prompt like following screenshot.


77251-image.png

For example, I put a file to Desktop, then I want to copy this text file to sdcard, I used following command to execute it

adb push C:\Users\xxxxusername\Desktop\Topic.txt  /mnt/sdcard/myfile.txt


Here is running screenshot.

77189-image.png

Best Regards,

Leon Lu



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (13.4 KiB)
image.png (460.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AliBilalStudent-0330 Did you try to use above ADB way to copy file to your android emulator? And you can use DDMS way to achieve it, but you have to root your android device.

0 Votes 0 ·