A Python script to sync photos and files between a Mac and an Android device using ADB, with options to convert HEIC files to JPG, and customizable sync modes. The script calculates metadata like the number of files, their total size, and provides a progress bar for tracking. After a successful sync, there’s an option to delete only the files from the source folder, keeping the folder structure intact.
- HEIC to JPG Conversion: Optionally converts HEIC files to JPG before transfer, with fallbacks in case of conversion issues.
- Customizable Sync Modes: Choose to sync all files or only those added/modified since the last sync.
- Progress Monitoring: Real-time progress bar with file count tracking.
- Selective Deletion: Deletes only files in the source folder post-transfer, preserving folder structure.
- Metadata Display: Shows the number of files, total size, and estimated time before starting the sync.
- Python 3.9 or later
adb(Android Debug Bridge) installed and accessible in PATH- Additional dependencies (install with
pip):pip install -r requirements.txt
Ensure your Android device is connected to the Mac via ADB. Enable Developer Options and USB Debugging on your Android device. You can verify the connection with:
adb devicesThis should list your device as connected. If you don’t see your device, make sure ADB is correctly installed and functioning.
-
Clone this repository.
-
Navigate to the project directory and ensure
adband Python dependencies are correctly set up. -
Run the script:
python3 main.py
-
Follow the prompts:
- Choose to convert HEIC files (default is to convert).
- Select sync mode: Sync All files or Sync Only New Files.
- Confirm the transfer based on file metadata.
- After a successful sync, confirm if you'd like to delete files from the source folder.
main.py: Main script file for syncing files.last_sync_time.txt: Stores the timestamp of the last sync for incremental syncing.
To run the sync with full features:
python3 main.pyThis project is licensed under the MIT License.