unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Skip Montanaro <skip.montanaro@gmail.com>
Cc: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Tramp access to Android?
Date: Thu, 03 Jan 2019 10:25:07 +0100	[thread overview]
Message-ID: <871s5u14b0.fsf@gmx.de> (raw)
In-Reply-To: <CANc-5Uyfeewinb=gibvEoRB=QusZPaXbmAgFHKW3CKVzfEB5uQ@mail.gmail.com> (Skip Montanaro's message of "Wed, 2 Jan 2019 18:49:35 -0600")

Skip Montanaro <skip.montanaro@gmail.com> 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:
>
> https://en.wikipedia.org/wiki/Up_to_eleven

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 192.168.86.249
> 18:34:54.118370 tramp-process-actions (6) #
> skip@192.168.86.249's password:
> Permission denied, please try again.
> skip@192.168.86.249'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 192.168.86.249* run *tramp/ssh 192.168.86.249*
> exec env ENV='' HISTFILE=~/.tramp_history PROMPT_COMMANec env ENV='' HISTFILE=~/.tramp_history PROMPT_COMMAN                         <\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bD='' PS1=\#\$\  PS2='' PS.tramp_history PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS                         <\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b3='' /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	other threads:[~2019-01-03  9:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 22:14 Tramp access to Android? Skip Montanaro
2019-01-02 23:01 ` Michael Albinus
2019-01-03  0:49   ` Skip Montanaro
2019-01-03  9:25     ` Michael Albinus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871s5u14b0.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=skip.montanaro@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).