Unity Android创建的CSV文件在设备上可见,而不是通过USB在PC上可见 [英] Unity Android created CSV file visible on device, not on PC via USB

查看:122
本文介绍了Unity Android创建的CSV文件在设备上可见,而不是通过USB在PC上可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个统一的应用程序,可以执行简单的文件创建并将其保存在CSV文件中.

I have a unity application that does a simple file creation and save on a CSV file.

    public void WriteDataToCsv() {
    StreamWriter outStream = File.CreateText (Application.persistentDataPath  + "/" + path);
//      GameObject.Find ("DebugText").GetComponent<Text> ().text = "Saved file to: " + Application.persistentDataPath + "/" + path;
    outStream.WriteLine (sb);
    outStream.Close ();

}

使用Play商店外的任何文件资源管理器应用程序(文件管理器和X-Plore),我都能看到该文件,甚至可以根据需要对其进行编辑.其列在Internal Storage \ Android \ data \ com.test.app \ files \ data.csv

Using any file explorer app off the Play store (both File Manager and X-Plore) I am able to see the file, and even edit it if i want. Its listed under Internal Storage\Android\data\com.test.app\files\data.csv

在PC端,我可以安装我的Google Pixel,导航到相同位置(内部存储\ Android \ data \ com.test.app \ files),但文件夹为空.

On the PC side, i can mount my Google Pixel, navigate to the same location (Internal Storage\Android\data\com.test.app\files) but the folder is empty.

我尝试插入和拔出手机,更改手机上的USB文件传输模式,等等...

I've tried plugging and unplugging in the phone, changing the USB file transfer mode on the phone, etc...

有人有什么想法吗? Windows 10,手机为Google Pixel 128gb. 同样,我可以在手机上找到该文件,并在其中看到数据,但在PC上看不到.我需要设置权限吗?!

Anyone have any ideas? Windows 10, and the phone is a Google Pixel 128gb. Again, i can find the file and see the data there on the phone, but not on the PC. Are there permissions i need to be setting?!

推荐答案

我正在做类似的事情,而且我已经能够立即看到文件的变化.重新启动手机后,文件夹变为可用.因此,如果您在插入手机时更改了文件中的内容,则应更新文件.

I'm doing something like that and I've been able to see the file changing right away. After restarting your phone, the folder turns available. So if you change something in the file when you plug your phone, the file should be updated.

这篇关于Unity Android创建的CSV文件在设备上可见,而不是通过USB在PC上可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆