[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp access to Android?

From: Michael Albinus
Subject: Re: Tramp access to Android?
Date: Thu, 03 Jan 2019 10:25:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Skip Montanaro <address@hidden> writes:

Hi Skip,

>> > tramp-verbose was set to 10. Should I try 11? :-)
>> But then I would like to see the complete Tramp debug buffer.
> Ah, missed that. See attached file. BTW, 11 was a joke which maybe
> doesn't translate well out of the US:

Thanks, I didn't know this.

Thinking about, I should perhaps add a new debug level 42, the next
after 10. With this level, Tramp explains to you what went wrong, and
how you could fix it. New features are added on-the-fly.

This would ease my life :-)

>> Btw, have you tried the "adb" method instead of "ssh", accessing
>> your Android device?
> I was unaware of that. I got an error about not being able to find an
> adb command, so found an adb package, installed it, and verified that
> I now have /usr/bin/adb. All that did was change the error message,
> and I'm not sure where to go with this next. A quick skim of the adb
> man page suggests only USB-connected devices are supported.

In theory, adb could go also over the air. I haven't tried it, and
indeed, the default configuration requires USB connection for adb.

Looking at the traces:

> 18:34:37.134933 tramp-send-command (6) # exec ssh  -p 2222 -o 
> ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none 
> 18:34:54.118370 tramp-process-actions (6) #
> address@hidden's password:
> Permission denied, please try again.
> address@hidden's password:
> :/storage/emulated/0 $

The exec call succeeded. You have reached your Android shell, which
shows you the prompt ":/storage/emulated/0 $"

> 18:34:54.121314 tramp-send-command (6) # exec env ENV='' 
> HISTFILE=~/.tramp_history PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh

Now, Tramp tries to open a local shell, calling /bin/sh. This fails. The
output is

> 18:34:54.203451 tramp-accept-process-output (10) # *tramp/ssh* 
> run *tramp/ssh*
> exec env ENV='' HISTFILE=~/.tramp_history PROMPT_COMMANec env ENV='' 
> HISTFILE=~/.tramp_history PROMPT_COMMAN                         
> <D='' PS1=\#\$\  PS2='' PS.tramp_history 
> PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS                         
> <3='' /bin/sh
> :/storage/emulated/0 $

This is likely, because Tramp has sent "PS1=\#\$\ ", and it expects a
respective prompt. But the prompt is still ":/storage/emulated/0 $".

There's nothing Tramp could do else. The sshd daemon does not work as
expected on the Android device. Which daemon do you run there? People
have reported they could get it work with Termux or SSHDroid. But I have
no experience with them, 'tho.

> Skip

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]