Copy/Transfer files from Android to Linux PC and from Linux PC to Android with adb, using script running from a Linux terminal inside Clex Terminal File Manager
- MX Linux 21 x386 and SAMSUNG GALAXY J5 Android 6.0.1
- If you use scrcpy to control your phone trough adb, this is a great metod to transfer files
- Or perhaps you can't transfer files in your Linux with the default mount options
- Or other reason
Is neccesary Android 6 and above
On Linux install dependencies:
sudo apt install git perl clex adb gnome-terminal bash
In your Android mobile you need enable USB Debugging like this:
Note: To each Android phone is diferent, yo need to search in Google to match your phone
In a terminal set this:
mkdir -p AppsLinux
cd AppsLinux
git clone https://github.com/wachin/adb-send-files
cd adb-send-files
./set_launcher_path.sh
cp adb-send-files.desktop $HOME/.local/share/applications/
mv adb-send-files.desktop set_launcher_path.sh vx_images/ && cd
echo "God Bless You"
This create and install all neccesary files under a Folder called:
AppLinux
please do not delete it
Now you need to create in your Android device in your HOME a folder called:
adb-android
And you need to create in your Linux Operative System in your HOME a folder called:
adb-linux
This is only if you have a micro SD Card extra in your phone, You need create in your Android SD extra storage device a folder called:
adb-SD-android
and in your Linux OS in your HOME the same folder mentioned above:
adb-linux
This step is totally neccesary, make sure the cable is good
Search in your Apps:
open it. The firs time when you open it appear clex with a message:
just hit Enter again:
something very important appears, a little tutorial:
End of options mark '--' is supported
Pager program: less
Text editor: vim
=== BEGIN ==================
CMD_F3=less -- $f
CMD_F4=vim -- $f
CMD_F5=cp -ir -- $f $2
CMD_F6=mv -i -- $f $2
CMD_F7=mkdir --
CMD_F8=rm -- $f
CMD_F9=lpr -- $f
=== END ====================
I don't use those instructions, but maybe they could be useful to you, for one thing, there they are
then in your keyboard write:
y
and hit Enter, and appear a message that said:
Configuration saved Please restart CLEX
Command successful. Press to continue.
These steps only need to be done once.
Now the first you have to do is clic on adb-devices.sh
When you hit Enter key it automatically writes the script name you have selected to be ready to be executed:
hit Enter again
then you see that clex run the script to start:
adb devices
command. Then hit Enter again
Now yo need to see what do you want to do
Copy some files or folder with files in your Linux Home folder:
adb-linux
then clic in:
adb-push-from-Linux-to-Android.sh
now check your home Android, appear a new folder with your files or folder with files
Copy some files or folder with files in your Android Home folder:
adb-android
then clic in:
adb-pull-from-Android-to-Linux.sh
now check your home Linux, appear a new folder with your files or folder with files
Copy some files or folder with files in your Linux Home folder:
adb-linux
then clic in:
adb-push-from-Linux-to-AndroidSD.sh
now check the storage of the micro SD Card in Android, appear a new folder with your files or folder with files
Copy some files or folder with files in your micro SD Card in Android folder:
adb-android
then clic in:
adb-pull-from-AndroidSD-to-Linux.sh
now check your home Linux, appear a new folder with your files or folder with files
Perhaps you want to do this. Open your Linux File Manager and navigate to this folder:
adb-send-files
If you use Thunar File Manger, right clic on:
main-run-script.sh
and open it with bash. If bash not appear you need to write that in the options:
Right clic in the script / Properties / Open with / othe application / Use personalized order /
in that write:
bash
Apply
The Linux File manager need to be configured to open scripts .sh
In other Linux File Manager like Dolphin you hit ENTER and propt if you want to execute, the same is for Caja, Nemo File Manager, and search how to do with others
Perhaps you need:
Help topics
http://www.clex.sk/help/MAIN.html
clex: Simplified file management | Inconsolation
https://inconsolation.wordpress.com/2013/07/20/clex-simplified-file-management/
God Bless
This is an idea from:
Copiar carpeta/archivos desde Android a Linux & Linux a Android con adb (por cable USB)
https://facilitarelsoftwarelibre.blogspot.com/2020/05/como-copiar-carpetaarchivo-desde.html