简体   繁体   English

将文件从Google驱动器下载到Xamarin Android Player

[英]Download files from google drive to Xamarin Android Player

Working on a Cocossharp application under Xamarin, I test it in Xamarin Android Player. 在Xamarin下的Cocossharp应用程序上工作,我在Xamarin Android Player中对其进行了测试。

It works but I need to upload json files from Emulator File System to my application. 它可以工作,但是我需要将JSON文件从仿真器文件系统上传到我的应用程序。

I did not find solution to upload files from the pc to the emulated device (Nexus 5 Lolipop 5.1.1). 我找不到将文件从PC上传到仿真设备(Nexus 5 Lolipop 5.1.1)的解决方案。

I transfered my json files to Google Drive. 我将json文件传输到了Google云端硬盘。

I connected to Google Drive to access my files from de emulator. 我已连接到Google云端硬盘,以通过仿真器访问文件。

I dowloaded files to the emulator. 我将文件下载到模拟器中。

In google drive my file name is ECG01.json 在Google驱动器中,我的文件名为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. 您可以使用adbAndroid Device Monitor将文件从本地PC的文件系统复制到Android仿真器。

Via the device monitor you can browse the files on your emulator and use the Push / Pull icons to copy files. 通过设备监视器,您可以浏览模拟器上的文件,并使用“ Push / Pull图标复制文件。

在此处输入图片说明

This UI is automating adb , so you can also do it via the cmd-line with adb : 该用户界面正在自动执行adb ,因此您也可以通过cmd行使用adb

Push a file from your PC to your emulator/device: 将文件从PC 送到仿真器/设备:

adb push <LocalPcFile> <TargetPath>

Pull a file from your emulator/device: 从模拟器/设备一个文件:

adb pull <FullPathOfFileOnEmulator>

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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