Unity Android created CSV file visible on device, not on PC via USB

淺唱寂寞╮ 提交于 2019-12-25 13:00:11

问题


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 ();

}

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

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.

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

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?!


回答1:


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.



来源:https://stackoverflow.com/questions/40389108/unity-android-created-csv-file-visible-on-device-not-on-pc-via-usb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!