Difference between revisions of "Accessing Android Data Directory"

From Luanti Wiki
Jump to navigation Jump to search
(Replaced content with "[https://dev.luanti.org/accessing-android-data-directory/ This page has moved to the Luanti Developer Wiki!]")
Tag: Replaced
 
Line 1: Line 1:
Starting with Minetest 5.4.2, the Android version now stores its user data in its scoped app storage at <code>/storage/emulated/0/Android/data/net.minetest.net/files/Minetest</code>. This is caused by a restriction of recent Android API levels and Google Play policies and it is unfortunately impossible to store it in the old more accessible <code>/storage/emulated/0/Minetest/</code> location.
+
[https://dev.luanti.org/accessing-android-data-directory/ This page has moved to the Luanti Developer Wiki!]
 
 
While it is officially intended by Google to not be accessible to regular users, there are still ways to circumvent it and still access the folder.
 
 
 
== Total Commander workaround (Android <=12) ==
 
[https://play.google.com/store/apps/details?id=com.ghisler.android.TotalCommander&hl=en_GB&gl=US Total Commander] (and possibly other file managers) have a method to workaround the restrictions put in place by Google, by taking advantage of a bug in Android 12 and below that allows file managers to be given permission to <code>/Android/data/</code>.
 
 
 
See https://forum.minetest.net/viewtopic.php?f=18&t=27684
 
 
 
== Through ADB (Needs computer) ==
 
You can access the scoped storage through ADB, a debugging tool part of the [https://developer.android.com/studio/releases/platform-tools Android platform tools]. In order to use ADB, you will need to enable USB debugging from the Android developer settings and connect your phone to a computer. On Linux, it should work out of the box. However on Windows you will need to find so called "ADB drivers" from your phone's manufacturer.
 
 
 
ADB is primarily a command-line tool, and you usually would want to use the <code>adb pull</code> and <code>adb push</code> commands similar to working with something like SCP. ADB also supports tab autocompletion on the remote side, so you can look at the directory structure on your phone while typing out a command. Some example commands:
 
 
 
* '''Pushing a world from your computer onto your phone:''' <code>adb push cool_world/ /storage/emulated/0/Android/data/net.minetest.minetest/files/Minetest/worlds/</code>
 
 
 
* '''Manually installing a mod not available on ContentDB:''' <code>adb push indev_mod/ /storage/emulated/0/Android/data/net.minetest.minetest/files/Minetest/mods/</code>
 
 
 
* '''Backing up a world to your computer:''' <code>adb pull /storage/emulated/0/Android/data/net.minetest.minetest/files/Minetest/worlds/cool_world/ cool_world_android_backup/</code>
 
 
 
* '''Backing up your entire Android user data to your computer:''' <code>adb pull /storage/emulated/0/Android/data/net.minetest.minetest/files/Minetest/ minetest_android_backup/</code>
 
 
 
The <code>adb shell</code> command is also available allowing you to launch a shell on your phone, use <code>cd /storage/emulated/0/Android/data/net.minetest.minetest/files/Minetest</code> to navigate into the user data and manage it with regular Linux terminal commands.
 

Latest revision as of 20:28, 15 December 2024