{{tag>Brouillon Android adb}} # Téléphone portable Android connexion PC sous GNU/Linux Voir aussi : * [Les 10 paliers de libération d’un téléphone Android](https://linuxfr.org/news/les-10-paliers-de-liberation-d-un-telephone-android) * [Utiliser son Android de façon plus sécurisée](http://linuxfr.org/news/utiliser-son-android-de-facon-plus-securisee) * [Les 11 meilleures applications open source sous Android](https://www.androidpit.fr/meilleures-applications-android-open-source) * https://linuxfr.org/users/gnumdk/journaux/droidian-un-os-fonctionnel-pour-les-telephones-android ## Notes adb Voir : * https://wiki.lineageos.org/adb_fastboot_guide#installing-adb-and-fastboot Préreq : - le mode debug USB doit être activé - le debug doit être autorisé. Si pas le cas passez en "Photo transfer (PTP) mode" Install ~~~bash apt-get install android-tools-adb ~~~ Autre outils ? ~~~bash apt-cache search android-tools ~~~ ~~~ android-tools-adb - Android Debug Bridge CLI tool android-tools-fsutils - Android ext4 utilities with sparse support android-tools-fastboot - outil en ligne de commande pour le protocole Fastboot d'Android ~~~ ### Connexion ~~~bash adb start-server ~~~ ~~~bash adb devices ~~~ ~~~bash lsusb ~~~ ~~~ Bus 002 Device 005: ID 0e8d:201d MediaTek Inc ~~~ `~/.android/adb_usb.ini` ~~~ini # 0xidVendorHere 0x0e8d ~~~ ou ~~~bash export ADB_VENDOR_KEYS=0x0e8d ~~~ Redémarrage d'adb pour le prise en compte de la modif ~~~bash adb start-server adb kill-server ~~~ Copie ~~~bash adb push plop.txt /sdcard/ ~~~ ### App ### Dépôts alternatifs Voir aussi : * [[https://gitlab.e.foundation/e/os/apps|App lounge]] * Obtainium Install de F-Droid un dépôt de Logiciel Libre ~~~bash wget https://f-droid.org/FDroid.apk adb install FDroid.apk ~~~ Mise à jour ~~~bash adb install -r cartes-gps-navigation-osmand.apk ~~~ Liste des applis installées ~~~bash adb shell 'pm list packages -f' ~~~ Exemple sauvegarde ~~~bash #adb backup -apk -shared -all -f backup.ab adb backup '-apk -shared -all -f backup.ab' ~~~ Tar du fichier de sauvegarde ~~~bash tail -n +5 backup.ab | pigz -d -z > backup.tar dd if=backup.ab bs=24 skip=1 | pigz -d -z > backup.tar ~~~ ## Notes fastboot Voir : * https://www.xda-developers.com/how-to-install-twrp/ * https://forum.xda-developers.com/huawei-y6/development/index-list-roms-y62018-t3854167 Prerequisites: * unlocked bootloader * adb and fastboot installed on your computer ~~~bash adb reboot bootloader #fastboot flash recovery twrp-2.8.x.x-xxx.img fastboot flash system fastboot reboot ~~~ Source : https://www.thecustomdroid.com/how-to-unlock-bootloader-on-huawei-devices/ ~~~bash adb reboot bootloader fastboot devices fastboot oem unlock 2155388422526005 fastboot getvar unlocked fastboot reboot ~~~ Source : https://www.kingoapp.com/root-tutorials/how-to-unlock-bootloader-android-device.htm ~~~bash apt-get install android-tools-fastboot fastboot devices fastboot oem unlock # Après confirmation sur le téléphone : fastboot reboot ~~~ Recovery Fastboot https://www.androidpit.com/forum/731450/wiko-sunny-how-to-get-twrp-recovery-installed ~~~bash fastboot devices fastboot oem unlock fastboot flash recovery recovery.img fastbook ~~~ ~~~ fastboot oem unlock < waiting for device > ~~~ ## Partage de fichier - montage lecteur ### Partage MTP (Transfère de fichiers) ~~~bash apt-get install mtp-tools jmtpfs mtpfs ~~~ avec interface graphique ~~~bash apt-get install gmtp ~~~ ~~~bash mkdir ~/mnt/mtp/ jmtpfs ~/mnt/mtp/ rsync -ax /media/cdrom/ mnt/mtp/Carte\ SD/plop/ fusermount ~/mnt/mtp/ ~~~ ### Partage PTP (Transfère de photos) ## Pb ~~~ $ adb install cartes-gps-navigation-osmand.apk 4529 KB/s (18980364 bytes in 4.092s) pkg: /data/local/tmp/cartes-gps-navigation-osmand.apk Failure [INSTALL_FAILED_ALREADY_EXISTS] $ adb install -r cartes-gps-navigation-osmand.apk 4861 KB/s (18980364 bytes in 3.812s) pkg: /data/local/tmp/cartes-gps-navigation-osmand.apk Success ~~~ ## Autres Logs ~~~bash adb logcat | grep $(adb shell ps | grep org.smssecure.smssecure | cut -c10-15) ~~~ ~~~bash logcat -C -b crash,system,main 'bash:S logcat:S mali_winsys:S *:I' ~~~ Droits appli ~~~bash adb shell pm grant uk.co.richyhbm.monochromatic android.permission.WRITE_SECURE_SETTINGS ~~~ root access \ https://f-droid.org/wiki/page/Should_I_root_my_device%3F debian \ https://www.debian-fr.org/t/debian-kit-debian-en-parallele-dandroid-sans-chroot/59967 Sécurité Sources inconnues Autoriser l'installation d'application issue de sources inconnues ~~~bash wget http://download.clockworkmod.com/superuser/superuser.zip mkdir plop cd plop unzip ../superuser.zip adb kill-server ~~~ ~~~ $ adb root adbd cannot run as root in production builds ~~~ ### Note root wiko SuperSU TWRP ( Team Win Recovery Project) wipe dalvik/cache Changer son IMEI ? https://play.google.com/store/apps/details?id=com.cryptotel.chamelephon ~~~bash adb shell getprop ro.build.version.release adb shell getprop | grep ro.build.version.release ~~~ ## Autres Désinstaller une application système ~~~bash adb shell pm uninstall -k --user 0 foundation.e.mail ~~~