Skip to content

Instantly share code, notes, and snippets.

@rolfn
Last active December 19, 2018 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolfn/7345cf7094bfe9cf16f5586b69b8d593 to your computer and use it in GitHub Desktop.
Save rolfn/7345cf7094bfe9cf16f5586b69b8d593 to your computer and use it in GitHub Desktop.
Notizen zu Android und Xiaomi Redmi Note 5 Pro

Notizen zu »Android« und »Xiaomi Redmi Note 5«

Im Folgenden sollen in lockerer Folge Erkenntnisse und Probleme zum Betriebssystem »Android« im Allgemeinen und zu dem Smartphone »Xiaomi Redmi Note 5« im Speziellen dargestellt werden. Vorwiegend wird das PC-Betriebssystem »Linux« benutzt.

Zugriff auf das Android-Dateisystem per ADB (Android Debug Bridge)

Mit dem Programm »adb« (Bestandteil der »Android Development Tools«) lassen sich eine Vielzahl von Aufgaben im Zusammenhang mit Zugriff auf das Android-Betriebssystem lösen. Einige davon erfordern ROOT-Rechte. »adb« ist aber auch für den einfachen Dateitransfer zwischen Smartphone und PC geeignet.

Installation unter »openSUSE«

zypper in android-tools

Installation unter »Ubuntu«

apt install adb fastboot

Anwendung

Suche nach dem Smartphone (per USB angeschlossen):

$ adb devices
List of devices attached
xxxxxxx device

Shell auf dem Gerät starten und Befehl ausführen:

$ adb shell ls -l /sdcard/DCIM/Camera/
total 4096
-rw-rw---- 1 root sdcard_rw 4193958 2018-10-25 18:26 IMG_20181025_182640.jpg

Datei zum PC kopieren:

$ adb pull /sdcard/DCIM/Camera/IMG_20181025_182640.jpg
/sdcard/DCIM/Camera/IMG_20181025_182640.jpg: 1 file pulled. 12.9 MB/s
(4193958 bytes in 0.309s)

Datei zum Smartphone kopieren:

adb push PixelExperience_whyred-9.0-20181218-2248-OFFICIAL.zip /sdcard/
PixelExperience_whyred-9.0-20181218-22...1.8 MB/s (1094079728 bytes in 47.816s)

Interaktive Shell auf dem Smartphone starten:

$ adb shell
1|whyred:/ $ ls
acct  bugreports  charger  cust  data  dev  etc  mnt  persist  res  sbin
storage  system  bt_firmware cache  config  d  default.prop  dsp
firmware  oem  proc  root  sdcard  sys  vendor 

Zugriff auf das Android-Dateisystem per Mount (MTP)

Mittels Zugriff per »MTP« (»Media Transfer Protocol«) und eines FUSE-Mount-Progamms lässt sich das Android-Dateisystem in das Linux-Dateisystem einbinden. Es wird im Folgenden davon ausgegangen, dass das Verzeichnis ~/phone (Mountpoint) existiert. Es wäre gut, wenn man erreichen könnte, dass der Mount-Prozess automatisch erfolgt (UDEV-Regel?).

»openSUSE«

Installation

zypper in mtpfs mtp-tools simple-mtpfs

Anwendung

Suche nach dem Smartphone (per USB angeschlossen):

$ simple-mtpfs -l
1: XiaomiMi-2s (MTP)

Mounten:

$ simple-mtpfs ~/phone
$ ls ~/phone/DCIM/Camera/
IMG_20181025_182640.jpg

Unmounten:

$ fusermount -u ~/phone

»Ubuntu«

Installation

apt install mtpfs mtp-tools jmtpfs

Anwendung

Suche nach dem Smartphone (per USB angeschlossen):

jmtpfs -l
...

Mounten:

$ jmtpfs ~/phone
$ ls ~/phone/
Android  DCIM  dctp  did  MIUI  Pictures

Unmounten:

$ fusermount -u ~/phone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment