• Godot Help
  • Can I directly access files saved on Android to user:// ?

Hi everyone

My program saves files to user://. I'd like to find these files on my phone and copy them to another phone. Is it possible?

I used
ProjectSettings.globalize_path("user://")

to show where the file saved and got

/data/org.godotengine.[APP_NAME]/files/

However, when I went to the directory, it was empty (I have show hidden files on). When I checked the properties of /files/, it showed 0 bytes and zero files.

I did a file search on my phone under the file name and nothing came up either.

Thanks

    OofStatement However, when I went to the directory, it was empty

    The Android O/S prevents you from seeing an app's private files.

    But you can access the files with adb (Android Debug Bridge).

    In this example, the app's Unique Name is com.example.myapp:

    adb shell
    cd /data
    run-as com.example.myapp
    ls -l files

    In your case, the app's Unique Name would be org.godotengine.[APP_NAME].

    You can use the adb pull subcommand to copy files, but I don't know if the pull and run-as subcommands can be combined.
    https://developer.android.com/tools/adb#copyfiles

    You might need to place the files in a common location that other apps can access, but how to do that is beyond my knowledge.