A new way to backup your android phone (via wireless) to your pc!
MTP is the tool provided by Windows to manage your phone files -or so their creators pretend-. After several frustrating attempts to use it, I decided to come to a different solution. I wrote a python script as a secure and suitable way to transfer my files. By now it is only functional for phones using Android because ADB, the Android Debug Bridge, is the system I connected my devices through. Thus, it also works for Windows, Mac and Linux. Any other systems will depend on ADB availability -or on any similar tool-.
You can fork, clone or just download the .zip of this project. Go to your git bash and type git clone https://github.com/ajuancer/jabs
.
As this script uses the ADB, you will need to download it from the official Android site. If you are an android developer and you have the Android SDK Platform-Tools package, ADB is by default located in the platform-tools
dir (you can download or update this package through the SDK manager).
You can visit the official documentation for more info.
- Navigate to the directory where the ADB you have just downloaded is located (the folder with the
adb.exe
file). - Open a terminal in that directory.
- Connect the phone to your computer with a USB cable.
- Say to your phone "please, listen to a TCP/IP connection on this port!" with
adb tcpip 5555
. - Disconnect the USB from your phone.
- Now run
adb kill-server
to ensure no conflicts while connecting to the phone. You can now close the terminal.
Check the android documentation for more info about this tool.
Note 1: Please note that the android guide performs some final different steps because the goal is different.
Note 2: If your Android version is 11 or higher, you can follow different steps as stated in the documentation.
Now you just need to specify some parameters:
- The IP of your phone. Usually it is detailed in the Wifi settings. It follows the following pattern:
192.168.x.jj
, where thex
is commonly a0
andjj
a two-digit number. - The path to where the ADB key you generated in step #2 is located. This file works just like in a lock, allowing the computer to connect to your phone. Please keep it private.
- The path to the root dir of your backup folder (where you want your files to be saved). For example, if you want to save them is an external drive
E:
, on the folderandroid_backup
, your backup path isE:/android_backup
. - The path of the folder you want to backup. This is the folder of the android device. You need to specify the absolute path, so it should start with a slash (
/
some/path/
). You can get this path using any file explorer of your device. A common path to the camera folder is/storage/emulated/0/DCIM/Camera/
.
- Get the necessary libraries with
pip install requeriments.txt
. - Run the
main.py
file. If you need help, try withpy main.py -h
.
Help: If you have followed the previous step, you just need to open a console in the directory where the main.py
file is and write py main.py phone_IP ADB_key backup_folder phone_folder
, but replacing phone_IP
with what you obtained in step 3.1, ADB_key
with 3.2, backup_folder
with 3.3 and phone_folder
with 3.4.
Although no documentation is written, you can fork this project and made the changes you want. You can also open an issue suggesting any kind of implementation. If you have any problem, you can always contact me.
Start by opening an issue here.
Under GNU Affero v3. See details.