Tramp uses the adb method to access Android devices.
Android devices provide a restricted shell access through an USB
connection. The local host must have the adb program
installed. Usually, it is sufficient to open the file
/adb::/. Then you can navigate in the filesystem via
Alternatively, applications such as
SSHDroid that run
sshd process on the Android device can accept any
ssh-based methods provided these settings are adjusted:
(add-to-list 'tramp-connection-properties (list (regexp-quote "192.168.0.26") "remote-shell" "sh"))
where ‘192.168.0.26’ is the Android device's IP address. (see Predefined connection information).
(add-to-list 'tramp-remote-path 'tramp-own-remote-path) (add-to-list 'tramp-remote-path "/system/xbin")
(add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME")
To add a corresponding entry to the ~/.ssh/config file (recommended), use this:
Host android HostName 192.168.0.26 User root Port 2222
To use the host name ‘android’ instead of the IP address shown in the previous example, fix the connection properties as follows:
(add-to-list 'tramp-connection-properties (list (regexp-quote "android") "remote-shell" "sh"))
Open a remote connection with a more concise command C-x C-f /ssh:android: <RET>.