Table des matières

Shell adb pour android

Je l'utilise pour l'installation de Replicant ou LineageOS


Ressources :

Commandes

abd devices adb root adb shell

Provisionning :

#!/bin/bash
 
cat > /tmp/ins.sh <<EOF
touch /.test
uptime
EOF
 
/usr/bin/adb shell "$( cat /tmp/ins.sh )"

Enable SSH service

adb shell ssh-keygen -A adb shell cp /etc/ssh/sshd_config /data/ssh/
adb push ~/.ssh/id_rsa.pub /data/ssh/authorized_keys adb shell /system/bin/sshd

backup

adb shell ls /mnt/media_rw/4FBC-07D4/
adb forward tcp:12345 tcp:12345 adb shell nc -lp 12345 & nc 127.0.0.1 12345 < /tmp/cmd
file /usr/bin/adb /usr/bin/adb: symbolic link to ../lib/android-sdk/platform-tools/adb
adb forward tcp:12345 tcp:12345 adb shell busybox nc -lp 12345 -e "$@" &
adb shell netcat -s 127.0.0.1 -p 12345 -tL /bin/bash -l
sleep 1s exec nc -q 1 localhost 12345
nc 192.168.1.186 9760 <<END command1 command2 END
wget https://f-droid.org/repo/org.mozilla.klar_231.apk adb install org.mozilla.klar_231.apk
adb push my_script_file.sh /data/dir1/
adb shell sh data/dir1/my_script_file.sh
adb shell "$(cat script.sh)"
adb push org.mozilla.klar_231.apk /mnt/sdcard/Download/