Piloter son android avec Raspberry Pi et adb

Une bonne nouvelle, grâce a AdamOutler du forum XDA il est possible d’utiliser le Android Debug Bridge (adb) sur le Raspberry Pi très facilement.

Voila comment procéder :

Récupération de l’archive

apt-get install p7zip
wget 'http://forum.xda-developers.com/attachment.php?attachmentid=1392336&d=1349930509' -O adb.7z
7zr x adb.7z 
cp mypart/adb /usr/local/bin/

Et on test le binaire :

adb version
Android Debug Bridge version 1.0.29

Communication avec le smartphone

* En premier lieu il faut autoriser le debugage Android sur le smartphone
Paramètres / Options Devellopeur / Debogage Android

adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
SH1BVTRXXX	device

Installation des applications par défaut sur la carte SD

* On vérifie le setting actuel [0/auto] [1/internal] [2/external]

adb shell pm getInstallLocation
0[auto]

* On force le setting a external (si l’application est compatible)

adb shell pm setInstallLocation 2

Avoir un shell sur Android

adb shell
shell@android:/ $ ls   
acct
app-cache
cache
config
d
data
default.prop
dev
etc
init
init.cm.rc
init.goldfish.rc
init.marvel.rc
init.msm7x27.usb.rc
init.rc
init.trace.rc
init.usb.rc
mnt
proc
root
sbin
sd-ext
sdcard
storage
sys
system
ueventd.goldfish.rc
ueventd.marvel.rc
ueventd.rc
vendor

Transfert de fichiers sur/de la carte SD

* Download

adb pull /mnt/sdcard/BLU\ MOD\ V1.1.zip /root/
1544 KB/s (149377165 bytes in 94.433s)

* Upload

adb push /home/pi/test.txt /mnt/sdcard/

Zephilou

2 Responses

  1. Bonjour,

    Merci beaucoup pour ce tutorial.
    Il faut cependant remplacer « adb shell pm get_install_location » et
    « adb shell pm set_install_location 2 » par « adb shell pm getInstallLocation » et « adb shell pm setInstallLocation 2 » respectivement.

    Cordialement,
    Chris.

  2. Effectivement, merci pour ce commentaire Chris. L’article est mis à jour.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Post comment