Version: 1.6 Author: Rich Lewis - GitHub @RichLewis007 License: Free Open Source Software (MIT License)
🌐 View Project Website | 📖 Documentation | ⭐ Star on GitHub
Minecraft Android Backup via USB is free, open source software created by Rich Lewis. Easily backup your complete Minecraft Bedrock Edition worlds from your Android device to your computer via USB connection. This script uses ADB (Android Debug Bridge) to access protected app data directories and provides a user-friendly Text User Interface (TUI) for managing your Minecraft world backups. Worlds can be backed up as full folders or as .mcworld files.
Minecraft-Android-Backup-Via-USB is a comprehensive backup solution for Minecraft Bedrock Edition worlds stored on Android devices. The script connects to your Android device over USB using ADB, discovers all your Minecraft worlds, and provides an intuitive menu system to backup individual worlds or all worlds at once. You can choose to backup worlds as full folders or as .mcworld files.
Android's Scoped Storage system protects app data directories (including Minecraft worlds) from normal file access. You cannot simply browse to these folders using a file manager or MTP. ADB (Android Debug Bridge) provides the necessary system-level permissions to access these protected directories, making it the standard method for backing up app data.
Key Benefits:
- Access Protected Data: Bypasses Android Scoped Storage restrictions
-
Complete Backups: Captures entire world directories including all chunks and metadata
-
Multiple Formats: Choose between raw world folders or portable .mcworld files
-
User-Friendly: Interactive menu system with searchable world lists
-
Organized: Automatic timestamping and folder organization
-
Reliable: Direct USB connection ensures fast, reliable data transfer
The script provides a menu-driven interface that allows you to:
- Discover Worlds: Automatically finds all Minecraft worlds on your Android device
- Display Information: Shows actual world names (not just folder IDs) and sorts by most recently played
- Selective Backups: Choose individual worlds to backup or backup everything at once
- Format Choice: Export as complete world folders or portable .mcworld files
- Manage Backups: View backup location, clear cache, and organize your backups
- Interactive menu system - Supports fzf, gum, or basic select menu (auto-detects what's available)
- Lists all Minecraft worlds - Automatically discovers worlds from your Android device
- Displays world names - Shows actual world names from
levelname.txtfiles (not just folder IDs) - Sorted by most recently accessed - Worlds are automatically sorted by access date
- Individual or bulk backup - Backup one world at a time or all worlds at once
- Two backup formats:
- World folders: Full directory structure with descriptive names (
<world-name>_<world-id>) - .mcworld files: Zipped world archives ready for import into Minecraft
- World folders: Full directory structure with descriptive names (
- Automatic path detection - Tries primary path, falls back to alternative automatically
- Progress indicators - Spinners show progress during long operations
- Organized backup structure - Timestamps and organized folders for easy management
- Cache management - Caches world list (expires after 5 minutes) with manual clear option
- Finder integration - Automatically opens backup location in Finder (macOS)
Using Homebrew:
# Install ADB (Android Debug Bridge) - required
brew install android-platform-tools
# Install zip (for .mcworld export) - required
brew install zip
# Optional: Enhanced menu experience
brew install fzf # or
brew install gumUsing MacPorts:
# Install ADB (Android Debug Bridge) - required
sudo port install android-platform-tools
# Install zip (for .mcworld export) - required
sudo port install zip
# Optional: Enhanced menu experience
sudo port install fzf # or
sudo port install gum-
Enable USB Debugging:
- Settings → About Phone → Tap "Build Number" 7 times
- Settings → Developer Options → Enable "USB Debugging"
- Connect device via USB
- Accept the debugging prompt on your phone when connected
-
Verify ADB Connection:
adb devices # Should show your device with "device" status
- Clone or download this repository
- Make the script executable:
chmod +x minecraft-android-backup-via-usb.sh
./minecraft-android-backup-via-usb.shThe script will:
- Check for ADB installation
- Verify Android device connection
- Display an interactive menu with options
- Shows all Minecraft worlds from your device
- Worlds are sorted by most recently accessed
- Select a world to backup individually
- Choose backup format (world folder or .mcworld file)
- Returns to world list after backup to backup more
- Backs up all worlds at once
- Choose format (world folders or .mcworld files)
- Shows progress for each world
- Opens the backup directory in Finder (macOS)
- Shows backup location path on other systems
- Deletes the cached world list
- Shows cache file age and location
- Forces fresh fetch from device on next run
- Exits the program
Backups are saved to: ~/Downloads/Minecraft-Worlds-Backups/
Minecraft-Worlds-Backups/
├── world-folders/
│ └── <world-name>__<timestamp>/
│ └── <world-name>__<world-id>/
│ └── (world files)
└── mcworld-files/
└── <world-name>__<timestamp>/
└── <world-name>.mcworld
Example:
Minecraft-Worlds-Backups/
├── world-folders/
│ └── My-World__2024-01-15__02-30-45-PM/
│ └── My-World__ABC123DEF/
│ ├── levelname.txt
│ ├── level.dat
│ └── ...
└── mcworld-files/
└── My-World__2024-01-15__02-30-45-PM/
└── My-World.mcworld
This section explains the technical implementation and workflow of the script.
The script uses ADB (Android Debug Bridge) over a USB cable connection to access your Android device. Here's why this approach is necessary:
- Android Scoped Storage: Modern Android versions protect app data directories
- Protected Path: Minecraft worlds are stored in
/Android/data/which requires special permissions - ADB Solution: ADB provides system-level access that bypasses these restrictions
- USB Connection: Ensures reliable, high-speed data transfer for large world files
- Standard Method: This is the official and recommended way to access protected app data
Process Flow:
- Script checks for ADB installation
- Verifies USB connection to Android device
- Uses
adb shellto access protected directories - Uses
adb pullto transfer world files to your computer
The script automatically detects the correct Minecraft worlds path by trying multiple locations:
-
Primary Path (most common):
/storage/emulated/0/Android/data/com.mojang.minecraftpe/files/games/com.mojang/minecraftWorldsThis is the standard path for Android's primary storage partition.
-
Alternative Path (fallback):
/sdcard/Android/data/com.mojang.minecraftpe/files/games/com.mojang/minecraftWorldsSome devices or Android versions use
/sdcardinstead of/storage/emulated/0.
The script tries the primary path first, and if it doesn't exist or isn't accessible, automatically falls back to the alternative path. This ensures compatibility across different Android devices and versions.
The script performs several steps to discover and display your worlds:
-
Directory Listing:
- Uses ADB to list all directories in the Minecraft worlds folder
- Filters to only include actual directories (not files)
-
Name Resolution:
- For each world directory, reads
levelname.txtto get the actual world name - Falls back to directory ID if
levelname.txtis not available - Handles cases where world names contain special characters
- For each world directory, reads
-
Metadata Collection:
- Retrieves access time (atime) for each world directory using
statcommand via ADB - Access time indicates when the world was last opened/played
- Retrieves access time (atime) for each world directory using
-
Sorting:
- Worlds are sorted by access time in descending order
- Most recently played worlds appear first in the menu
- This helps you quickly find your active worlds
-
Display:
- Shows world name and ID in the format:
World Name (ABC123DEF) - Uses the resolved world name from
levelname.txt, not just the folder ID
- Shows world name and ID in the format:
To improve performance and reduce unnecessary ADB calls, the script implements a caching system:
- Cache Storage: World list is saved to a temporary file
- Cache Location:
${TMPDIR:-/tmp}/minecraft-worlds-cache.txt - Cache Contents: Stores world IDs and names (not actual world files)
- Expiration: Cache automatically expires after 5 minutes
- Refresh Trigger: Cache is refreshed when:
- Cache file is older than 5 minutes
- Cache file doesn't exist
- User manually clears cache via menu
Benefits:
- Faster subsequent menu operations
- Reduces load on Android device
- Still provides fresh data when needed
Cache Structure:
<number_of_worlds>
<world_id_1>
<world_name_1>
<world_id_2>
<world_name_2>
...
The script supports two backup formats, each optimized for different use cases:
What it is:
- Complete directory structure exactly as stored on your Android device
- All files preserved in their original locations and names
- Full world data including chunks, metadata, resource packs, behavior packs, etc.
Directory Structure:
~/Downloads/Minecraft-Worlds-Backups/world-folders/
└── <sanitized-world-name>__<timestamp>/
└── <sanitized-world-name>__<world-id>/
├── levelname.txt # World name
├── level.dat # World metadata and settings
├── world_icon.jpeg # World icon (if available)
├── db/ # Chunk database
├── behavior_packs/ # Behavior packs
├── resource_packs/ # Resource packs
└── ... (all other world files)
Use Cases:
- Manual inspection or editing of world files
- Advanced world manipulation
- Preserving exact file structure
- Accessing individual files within the world
Advantages:
- Preserves complete world structure
- Easy to navigate and modify
- Suitable for technical users
- Can restore individual files if needed
What it is:
- Standard Minecraft world archive format
- Single ZIP file containing all world data
- Compatible with Minecraft's built-in import/export system
- Portable and easy to share
File Structure:
~/Downloads/Minecraft-Worlds-Backups/mcworld-files/
└── <sanitized-world-name>__<timestamp>/
├── <sanitized-world-name>.mcworld # ZIP archive
└── world_icon.jpeg # World icon (if available)
Use Cases:
- Sharing worlds with others
- Importing into Minecraft on other devices
- Backup storage (compact format)
- Email or cloud storage
Advantages:
- Single file per world (easy to manage)
- Standard Minecraft format
- Can be directly imported by double-clicking
- Smaller and more portable than folder format
Technical Details:
- Created using standard
zipcommand - All world files are included in the archive
- Maintains directory structure within the ZIP
- Compatible with Minecraft Bedrock Edition import system
- Close Minecraft before backing up - Ensures best consistency (worlds aren't locked)
- USB Debugging must stay enabled - Required for ADB to work
- Keep device connected - During the backup process
- World names are sanitized - Special characters are replaced with dashes for safe file names
- Access times may vary - Depending on Android system configuration
- Verify USB Debugging is enabled
- Connect device via USB
- Accept the debugging prompt on your phone
- Run
adb devicesto verify connection
- Make sure Minecraft is installed
- Verify you have at least one world created
- Check that the Minecraft app has been opened at least once
- Install Android Platform Tools:
brew install android-platform-tools # or sudo port install android-platform-tools
- Required for .mcworld export:
brew install zip # or sudo port install zip
- Use "Clear World List Cache" menu option
- Or manually delete:
rm /tmp/minecraft-worlds-cache.txt - Cache automatically expires after 5 minutes
- Access time sorting depends on Android system settings
- Some Android versions may not update access times reliably
- Try clearing cache to force fresh discovery
ADB (Android Debug Bridge) is used because it provides elevated permissions needed to access Minecraft world directories, which are located in:
/storage/emulated/0/Android/data/com.mojang.minecraftpe/files/games/com.mojang/minecraftWorlds
These directories are protected by Android Scoped Storage and cannot be accessed through normal file browsing or SSHFS. ADB bypasses these restrictions, allowing direct access to app data folders.
- Elevated permissions: ADB runs with system-level access
- Access protected folders: Can access
/Android/data/*directories - Direct file operations: Pull files directly without intermediate steps
- Automated backups: Perfect for scripting and batch operations
MIT License
Copyright (c) 2024 Rich Lewis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
If this tool has helped you protect your Minecraft worlds, please consider:
- ⭐ Starring the repository on GitHub - It helps others discover this tool
- 👤 Following @RichLewis007 - Stay updated on new projects and updates
- 🐛 Reporting issues - Help improve the tool by reporting bugs or suggesting features
- 📢 Sharing with friends - If you know other Minecraft players who could benefit from this
Minecraft Android Backup via USB is free, open source software created by Rich Lewis. It's available under the MIT License, meaning you can use, modify, and distribute it freely.
- Based on UI components from bash-ui.sh
- Uses fzf/gum for enhanced menu experience (with basic fallback)
- 🌐 Visit the project website for more information and visual documentation



