简体   繁体   中英

Download files from google drive to Xamarin Android Player

Working on a Cocossharp application under Xamarin, I test it in Xamarin Android Player.

It works but I need to upload json files from Emulator File System to my application.

I did not find solution to upload files from the pc to the emulated device (Nexus 5 Lolipop 5.1.1).

I transfered my json files to Google Drive.

I connected to Google Drive to access my files from de emulator.

I dowloaded files to the emulator.

In google drive my file name is ECG01.json

In the device, the file name become an ununderstandable file name dot bin.

When I try to open it, the emulator display an error : can't open file.

Is there a solution to transfert files unchanged to the emulated device ?

You can use adb or Android Device Monitor to copy files from your local PC's file system to your Android Emulator.

Via the device monitor you can browse the files on your emulator and use the Push / Pull icons to copy files.

在此处输入图片说明

This UI is automating adb , so you can also do it via the cmd-line with adb :

Push a file from your PC to your emulator/device:

adb push <LocalPcFile> <TargetPath>

Pull a file from your emulator/device:

adb pull <FullPathOfFileOnEmulator>

Ref: https://developer.android.com/studio/command-line/adb.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM