{"id":25413701,"url":"https://github.com/dusanmadar/pysyncdroid","last_synced_at":"2025-09-11T16:12:15.590Z","repository":{"id":35272234,"uuid":"39532910","full_name":"DusanMadar/PySyncDroid","owner":"DusanMadar","description":"A simple way to synchronize an Android device connected to a Linux PC via MTP over USB","archived":false,"fork":false,"pushed_at":"2019-07-21T11:02:45.000Z","size":93,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-10T04:26:27.105Z","etag":null,"topics":["android","android-device","linux-pc","python","sync","synchronize-contents"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DusanMadar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-22T22:13:54.000Z","updated_at":"2023-12-31T17:10:26.000Z","dependencies_parsed_at":"2022-09-16T21:51:00.154Z","dependency_job_id":null,"html_url":"https://github.com/DusanMadar/PySyncDroid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanMadar%2FPySyncDroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanMadar%2FPySyncDroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanMadar%2FPySyncDroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanMadar%2FPySyncDroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DusanMadar","download_url":"https://codeload.github.com/DusanMadar/PySyncDroid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239139716,"owners_count":19588246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-device","linux-pc","python","sync","synchronize-contents"],"created_at":"2025-02-16T14:21:41.753Z","updated_at":"2025-02-16T14:21:42.358Z","avatar_url":"https://github.com/DusanMadar.png","language":"Python","readme":"[![Build Status](https://travis-ci.org/DusanMadar/PySyncDroid.svg?branch=master)](https://travis-ci.org/DusanMadar/PySyncDroid)\n[![Coverage Status](https://coveralls.io/repos/github/DusanMadar/PySyncDroid/badge.svg?branch=master)](https://coveralls.io/github/DusanMadar/PySyncDroid?branch=master)\n[![PyPI version](https://badge.fury.io/py/pysyncdroid.svg)](https://badge.fury.io/py/pysyncdroid)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n# PySyncDroid\nPySyncDroid is a Python 3 powered CLI tool providing a simple way to synchronize an Android device connected to a Linux PC via MTP over USB.\n\nNo special setup is required for the Android device.\n\n## Installation\n\n```bash\npip install pysyncdroid\n```\n\n## System requirements\nPySyncDroid leverages `lsusb`, `gvfs`, `mtp` and `readlink`.\n\n### lsusb\nMake sure you have `lsusb` installed on your computer as it is used to discover USB connected devices.\n\n### gvfs\nHere is a list of gvfs related packages I have installed on my system (Ubuntu 14.04 64b):\n```console\ndm@Z580:~$ dpkg --get-selections | grep gvfs\ngvfs:amd64             install\ngvfs-backends          install\ngvfs-bin               install\ngvfs-common            install\ngvfs-daemons           install\ngvfs-fuse              install\ngvfs-libs:amd64        install\n```\nUtilities as:\n * gvfs-ls\n * gvfs-cp\n * gvfs-rm\n * gvfs-mkdir\n * gvfs-mount\n\n*must* be present on your system and executable from the terminal.\n\n### mtp\nHere is a list of mtp related packages I have installed on my system (Ubuntu 14.04 64b):\n```console\ndm@Z580:~$ dpkg --get-selections | grep mtp\nlibmtp-common          install\nlibmtp-runtime         install\nlibmtp9:amd64          install\n```\n\n## Usage\n1. Connect your Android device with an USB cable to your computer\n2. Unlock your device to notify the computer about its presence\n    * unlock is conducted only once and it is **not necessary** that the device stays unlocked during the synchronizing process\n    * `Developer Options` don't have to be enabled on the device\n3. Make sure the device is connected as a **Media device (MTP)**\n   * you should now be able to see your device in *computer file manager*\n4. Synchronize using PySyncDroid\n\n### Examples\nFor more details about how to use PySyncDroid and what options are available\n```console\ndm@Z580:~/Desktop$ pysyncdroid -h\n```\nSynchronize contents of the *Rock* directory from computer to the device (`vendor` and `model` names are *case insensitive*)\n```console\ndm@Z580:~/Desktop$ pysyncdroid -V samsung -M gt-i9300 -s ~/Music/Rock -d Card/Music/Rock\n```\nSynchronize contents of the *Music* directory from the device to computer, removing unmatched files (i.e. files, which are present only on computer, but not on the device) and overwriting existing files. Also, display what is going on (notice the `-v` flag).\nChild directories are automaticaly created in the destination directory (*~/Music*, in this case) as necessary.\n```console\ndm@Z580:~$ pysyncdroid -ov -V samsung -M gt-i9300 -s Phone/Music -d Music -u remove\n```\n\nProvide a mapping file (see `src2dest_example.txt` for the file structure) if you need to synchronize more than a single directory.\n```console\ndm@Z580:~/Desktop$ pysyncdroid -V samsung -M gt-i9300 -f /home/dm/Desktop/src2dest_example.txt -v\n```\n\n### Device not found error\nIf you keep getting the following error message `Device \"\u003cvendor\u003e \u003cmodel\u003e\" not found` make sure the device is connected to the computer and you can access it via file manager.\nRun `lsusb` and check the output for desired `vendor` or `model` names. For example, I get the following string for my Samsung Galaxy SIII `Bus 001 Device 011: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1]` and therefore I use `PySyncDroid` as `pysyncdroid -V samsung -M gt-i9300`.\n\n## Limitations \u0026 known issues\n* `source` and `destination` must be a path to a **directory**\n* `single file` synchronization is **not supported**\n* `device path` must be a **relative path** starting with one of the device directories visible in the computer file manager, e.g.:\n    * *Card/Music*\n    * *Phone/DCIM*\n    * *Tablet/Download*\n\n### Sync from computer to device\nIf the sync process takes a bit longer (10+ minutes), it's very likely that you will get an error like:\n`The name :\u003cname\u003e was not provided by any .service files` or `Message did not receive a reply (timeout by message bus)`.\n\nIt seems like *the device drops the MTP connection* after a certain amount of time/certaing amount of data transfered. Resetting USB connection (remove and plug the cable back to your computer) and unlocking the device again will reconnect it so you can re-run the last `pysyncdroid` command. It will continue to sync where it left off (assuming you are not using the `-o` flag).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdusanmadar%2Fpysyncdroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdusanmadar%2Fpysyncdroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdusanmadar%2Fpysyncdroid/lists"}