问题
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