A script to migrate installed packages between Android user profiles using ADB.
This script lists all installed packages for a specified user profile on an Android device and installs those packages for another user profile. It utilizes ADB commands to achieve this.
- Python 3.x
- ADB installed and configured
- Android device connected via USB with USB debugging enabled
-
Ensure ADB is Installed and Configured:
- Download and install ADB from the Android developer site.
- Ensure
adb.exeis accessible in your system PATH.
-
Connect Your Android Device:
- Connect your device to your computer via USB.
- Enable USB debugging on your device (Settings > Developer options > USB debugging).
-
Clone the Repository:
-
Navigate to the Repository Folder:
- Navigate to the cloned repository folder:
cd adb-package-migrator
- Navigate to the cloned repository folder:
-
Get the List of Users on the Device:
- Use the following ADB command to list all users on the device:
- Linux/Mac:
./adb.exe shell pm list users
- Windows:
adb.exe shell pm list users
- Note down the user IDs for the profiles you want to migrate packages between.
- Use the following ADB command to list all users on the device:
-
Edit the Script:
- Open the
move_packages.pyfile in a text editor or IDE. - Ensure the
adb_pathvariable points to the correct path ofadb.exeon your system.
- Open the
-
Run the Script:
- Execute the script using Python:
python move_packages.py <profile_id>
- Execute the script using Python:
- Example:
python move_packages.py 10