Best remote shell alternative to adb shell? - Android Q&A, Help & Troubleshooting

What's a good approach for getting a remote shell from Windows? adb shell just doesn't cut it, I tried it from the Win command prompt and from cygwin's mintty and there are all sorts of terminal problems, cursor keys not working, escape sequences not working, vi is a mess, etc.
So what's the proper way to set up a remote shell so that you get close to the Linux experience while connecting from Windows? E.g. sshd and connect via putty, busybox installed, etc. Any recommendations please before I go and try a bunch of things and make a mess? Thanks!

sirxdroid said:
What's a good approach for getting a remote shell from Windows? adb shell just doesn't cut it, I tried it from the Win command prompt and from cygwin's mintty and there are all sorts of terminal problems, cursor keys not working, escape sequences not working, vi is a mess, etc.
So what's the proper way to set up a remote shell so that you get close to the Linux experience while connecting from Windows? E.g. sshd and connect via putty, busybox installed, etc. Any recommendations please before I go and try a bunch of things and make a mess? Thanks!
Click to expand...
Click to collapse
SSH is a good alternative. You can then connect via PUTTY from your Windos machine. There's a small ssh server for embedded system called "dropbear", alto not fully functional (no scp/sftp support), it's easier to install than openssh. If you don't want to install it in the Android OS native, you can always download an app including it, there's a few of them.
Myself I'm using openssh, using my fully GNU Debian environment (see my signature). This solution also enables me to use X-windows for remote access to my Android. But I guess this is overkill for you. But still, very cool.

kuisma said:
SSH is a good alternative. You can then connect via PUTTY from your Windos machine. There's a small ssh server for embedded system called "dropbear", alto not fully functional (no scp/sftp support), it's easier to install than openssh. If you don't want to install it in the Android OS native, you can always download an app including it, there's a few of them.
Myself I'm using openssh, using my fully GNU Debian environment (see my signature). This solution also enables me to use X-windows for remote access to my Android. But I guess this is overkill for you. But still, very cool.
Click to expand...
Click to collapse
Thanks! Your link Run a complete GNU/Linux distribution on your Android is pretty cool!
I tried DropBear SSH Server II and SSHDroid and they seem to work well enough for what I need. Next step is to get sftp working which apparently it is possible with DropBear SSH Server II with a bit of manual work.

Related

[Q] How to type commands on gTab?

I'm having issues connecting the Microsoft Bluetooth keyboard to my gTab, and I've been trying to use Bluetooth Keyboard Easy Connect, but that can't seem to install Bluez Utils, because I can't find them anywhere on the device. It looks like the device is mounted R/O and I have no idea how to mount it otherwise.
But back to my point, I've seen tutorials for doing this manually, and all involve typing commands at a command line, some using adb. Is there a comprehensive tutorial for typing commands in these examples that people give?
Also, for what it's worth, I have the dev kit installed, and I try doing adb, but it tells me device not found, so apparently I'm not connecting it correctly and I can't find any instructions on how to do such a thing.
I'm not able to find anything on this search-wise (well, there is one post in XPERIA X8 General, but that involved removing a battery, which you can't do on the gTab).
Any help would be appreciated!
There are several ways to go. If you use Windows you need drivers and if you use Linux you'll need to make an entry in your udev rules so the tablet is recognized as a device. If you search the overall gtab forums for "adb windows" or "adb linux" you should be ok there.
So ADB is one way to get a shell. You can also download something from the market like Android Terminal or Better Terminal. Of course, those are easier to use if you have an external keyboard ;-) You can get Full Keyboard or other keyboards that have all the exotic keys.
The 3rd way to do it is to run sshdroid or another ssh server and then use ssh or putty to connect to your device remotely.
Any one of these methods will give you a shell prompt either on the screen or back at your PC.

Recompiling Platform For Logitech Revue

Alright so I am playing around with my Logitech Revue, and I can connect via ADB is there a way I can use this to DL the files I need to compile the platform?
Also more generally without the use of applications like diff and grep what is the best way to analyze what files are necessary to pull down for a port.
So basically here are my skills...
I can build a platform using the source found at s.android.com
I can adb into my Logitech Revue
so how do I create a system image and flash my existing revue adding an additional system application (call it SampleApplication)
Thanks guys
P.S. If you want to connect...
1.) go into you Google TV and set your remote debugger to be the IP of the computer running adb.
2.) adb connect <IP of GOOGLE TV>
3.) adb shell
4.) profit???????

Make android device to be a print server

Dear all
I want to connect a usb printer to an android device like android tv box to share it through LAN. Does anybody know an application can make android device to be a print server, or how can i make andoid device to be a print server
Thanks
Have you managed to do anything. ?
+1
I guess there is still no solution to this. I have same setup with a TV-Box, but can't figure out how to share over the network. I tried Servers Ultimate and the LPD print server it has, but had no luck getting it to work. I think we would need CUPS built in to the kernel of our device ROM.
I hope someone comes up with a solution. Doesn't seem like a big challenge.
If only google Cloud Print could see the attached USB printer and make it accessible.
You can set up Linux chroot (I used Linux Deploy) to install a cups server and share printer over the network. I am using this solution for a long time and it does the job.
krzysiek.karolak1 said:
You can set up Linux chroot (I used Linux Deploy) to install a cups server and share printer over the network. I am using this solution for a long time and it does the job.
Click to expand...
Click to collapse
Do u have tutorial for this? thanks
I am also interested in this.
ket_92 said:
Do u have tutorial for this? thanks
Click to expand...
Click to collapse
It will take some time for you if you haven't used linux and if you do not have idea about how to execute any of the steps I mention below.
Follow these steps:
* Root your phone
* Install Linux Deploy from play store
* Select distribution as Ubuntu in Linux Deploy and install it (this will take time as it will download the linux image and install it)
* In the config options, select VNC or SSH (this is only to install the cups package)
* Login to the linux machine (running on your android phone) using SSH or VNC
* Install cups, cups-daemon packages (run command "sudo apt-get install cups cups-daemon")
* Start cups daemon: run command "sudo /etc/init.d/cups start"
* Install system-config-printer-gnome if using VNC (run command "sudo apt-get install system-config-printer-gnome")
* If using VNC, connect to the machine using a VNC client and run "sudo /usr/share/system-config-printer/system-config-printer.py". In the screen, add your printer and share it to be used over network
* If using SSH, connect to the machine and add your printer using lpadmin (this is a bit advanced, use VNC to avoid and set the printer easily)
Ok, if I set it like this, do I need to start that Linux after every reboot or it will work automatically? I would also like to use my Android TV box as a scanner server, cause I have HP MFP printer.
Thank you @krischat1001 for the steps.
I'm trying to make my printer working with this method (Brother DCP-165C connected to Khadas VIM2)
The Linux Deploy is running well with CUPS installed. The printer USB port was correctly identified (I think), I installed the cupswrapper official driver and selected it while adding the printer.
The problem is the printer never was triggered by CUPS, even while all the jobs are listed as done. I tried print a test page using CUPS and also print from another computer where the CUPS server was added.
What I can see in the printer screen is a fast message "Receiving data", for 100ms or so, on the exact moment I start a print job (this is the normal message shown while printing). But nothing is printed.
Is there any idea on whats going on?
fearbrain said:
Thank you @krischat1001 for the steps.
I'm trying to make my printer working with this method (Brother DCP-165C connected to Khadas VIM2)
The Linux Deploy is running well with CUPS installed. The printer USB port was correctly identified (I think), I installed the cupswrapper official driver and selected it while adding the printer.
The problem is the printer never was triggered by CUPS, even while all the jobs are listed as done. I tried print a test page using CUPS and also print from another computer where the CUPS server was added.
What I can see in the printer screen is a fast message "Receiving data", for 100ms or so, on the exact moment I start a print job (this is the normal message shown while printing). But nothing is printed.
Is there any idea on whats going on?
Click to expand...
Click to collapse
Hi,
Im planning to repurpose one of our old MXQ Pro Android TV Box into a C.U.P.S. print server soon.
I'm really interested whether you've managed to identify the root cause or fix for this issue.
I would first check whether firewall and whether port 631 is allowed in the local network; I would then also check whether C.U.P.S. listener is configured to any print service request in cupsd.conf.
Dshah79 said:
Hi,
Im planning to repurpose one of our old MXQ Pro Android TV Box into a C.U.P.S. print server soon.
I'm really interested whether you've managed to identify the root cause or fix for this issue.
I would first check whether firewall and whether port 631 is allowed in the local network; I would then also check whether C.U.P.S. listener is configured to any print service request in cupsd.conf.
Click to expand...
Click to collapse
It was a driver problem. I found the specific driver for my printer, and everything is working well now.
Good luck!
I am trying to do the same for an old android phone. Have installed Ubuntu using Linux deploy, installed Cups, Printer Config Gnome, as discussed in this forum.
Printer is Epson L130. Gutenprint supports it, a user post in their forum confirms it.
But nothing happens when I connect my phone to the printer using USB. Neither CUPS nor Printer GNOME detects a new printer.
I have tried 3 different rooted phones: Moto Atrix 2, Xiaomi Mi 3, Moto X Play with same result. I am using the stock kernel and Rom.
lsusb does not show my printer.
lsusb -t however shows the printer in one of the nodes.
Are you guys on a custom kernel/rom?
Any suggestion would be appreciated.
avisekjena said:
I am trying to do the same for an old android phone. Have installed Ubuntu using Linux deploy, installed Cups, Printer Config Gnome, as discussed in this forum.
Printer is Epson L130. Gutenprint supports it, a user post in their forum confirms it.
But nothing happens when I connect my phone to the printer using USB. Neither CUPS nor Printer GNOME detects a new printer.
I have tried 3 different rooted phones: Moto Atrix 2, Xiaomi Mi 3, Moto X Play with same result. I am using the stock kernel and Rom.
lsusb does not show my printer.
lsusb -t however shows the printer in one of the nodes.
Are you guys on a custom kernel/rom?
Any suggestion would be appreciated.
Click to expand...
Click to collapse
Hi,
are you able to connect Epson L130 with the android device as a print server. Please let me know, as I have also the same printer.
krischat1001 said:
It will take some time for you if you haven't used linux and if you do not have idea about how to execute any of the steps I mention below.
Follow these steps:
* Root your phone
* Install Linux Deploy from play store
* Select distribution as Ubuntu in Linux Deploy and install it (this will take time as it will download the linux image and install it)
* In the config options, select VNC or SSH (this is only to install the cups package)
* Login to the linux machine (running on your android phone) using SSH or VNC
* Install cups, cups-daemon packages (run command "sudo apt-get install cups cups-daemon")
* Start cups daemon: run command "sudo /etc/init.d/cups start"
* Install system-config-printer-gnome if using VNC (run command "sudo apt-get install system-config-printer-gnome")
* If using VNC, connect to the machine using a VNC client and run "sudo /usr/share/system-config-printer/system-config-printer.py". In the screen, add your printer and share it to be used over network
* If using SSH, connect to the machine and add your printer using lpadmin (this is a bit advanced, use VNC to avoid and set the printer easily)
Click to expand...
Click to collapse
How do I connect VNC viewer from a laptop? I'm of course in the same wifi network.
whats-in-a-name said:
How do I connect VNC viewer from a laptop? I'm of course in the same wifi network.
Click to expand...
Click to collapse
(I was trying from my browser, which didn't work) Now installed a vncviewer and was asked for credentails, so YES it works.
This is a confusing thread, but I just want to state that I can print from my Android phone to my old-but-networked HP Laserjet 2100tn printer without using an Internet print server and without installing or using Linux.
Newer Mopria-certified printers are even easier to set up to print from Android.
1. On Android, I installed an "lpd" print server which outputs PDF level 1.3
2. But my printer doesn't accept PDF - my printer wants PCL-5 instead
3. So I added a muPDF "faux printer driver" to "render" the PDF to a bitmap
This converts the PDF to a bitmap and then to PCL-5, which is then sent to the old networked printer via the Android "print server".
I gave up on CUPS though as nothing seemed to work with my Android-12/Windows-10 setup.
I have found a very simple solution.
1. Make a USB server using your android mobile connected to printer with the app "
VirtualHere USB Server"​2. Install the " VirtualHere client" in your windows/mac etc.
3. Connect the printer to your android mobile.
4. Run the server
5. In the windows , the client will detect the usb hub.
Now you are good to go.
Make sure that both server and client are connected over same network.

[Q] What's a good ssh server to run on the HOX+?

Any recommendations for a good ssh server to run on the phone? It's easier to me to run a shell, vi, scp via something like putty that works well as a real terminal than 'adb shell' via the command prompt where vi is all messed up, etc. I tried Android Commander as an alternative but it's too buggy at least against our phone.
So what is *the* ssh server to run on the phone with the option to keep it disabled most of the time, except when I need to use it?

Yoga Book & GnuRoot Debian

Hello community!
For those who are interested in installing a linux system (debian) on a NON-ROOTED Android device:
I managed to install GnuRoot referring to this tutorial:
https://www.xda-developers.com/guid...a-gnulinux-environment-on-any-android-device/
At first i had graphical errors when starting LXDE (like missing icons) due to missing libraries during the installation process.
I show you the steps for installing it, referring to above tutorial, but i added some new terminal commands, because there were libraries and dependencies missing when installing LXDE.
1) First install GnuRoot and XSDL server from playstore.
2) Let GnuRoot start and doing its installation. Then type in following terminal commands:
apt-get update
apt-get upgrade
dpkg-reconfigure tzdata <----- if you wanna change your locales
apt-get install libffi6 <------ this is one of the missing libraries, otherwise LXDE will have errors during its installation
apt-get install execstack <------ this is one of the missing libraries, otherwise LXDE will have errors during its installation
execstack -c /usr/lib/i386-linux-gnu/libffi.so.6 <------ this is one of the missing libraries, otherwise LXDE will have errors during its installation
apt-get install lxde-core <------- alternatively apt-get install lxde (for full LXDE with its apps)
3) start XSDL and make your configs (resolution etc.), let it run in the background
4) now type in GnuRoot following terminal commands:
export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4712
startlxde &
5) switch back to XSDL and then wait until the GUI (aka LXDE) starts
It still shows some bugs like "No Session for PID # xxxx" whenever i log in. So i hope that i can get help to install it better (correctly) from the community.
Alternatively:
In the last few days i managed to let GnuRoot Debian run LXDE and connect to it via VNC viewer by running a VNC server locally. So if you dont want to use XDSL, but VNC instead, you can follow these instructions:
Download "GnuRoot Debian" and "VNC Viewer - Remote Desktop" in playstore.
Start GnuRoot, let it do its things and then type in the these shell commands:
For installing LXDE:
apt-get update
apt-get install apt-utils
apt-get install dialog
apt-get install sudo
sudo apt-get install libffi6
sudo apt-get install execstack
sudo execstack -c /usr/lib/i386-linux-gnu/libffi.so.6
sudo apt-get upgrade
sudo apt-get install lxde-core
For installing VNC-Server:
sudo apt-get install tightvncserver
su - root
tightvncserver :1 (<---- just start the VNC-Server in order to create the xstartup-file)
sudo apt-get install nano
nano ~/.vnc/xstartup
an editor will show up and add this line at the bottom of the xstartup-file
/usr/bin/lxsession -s LXDE &
save the file and continue with these commands:
vncserver -kill :1 (<--- kill the server)
tightvncserver :1 -geometry 1280x720 -depth 24 (<--- start it again with this resolution, you can choose any resolution you want)
Now open VNC-Viewer and create a new item in order to connect to the VNC-Server
type in this adress: localhost:1
There you go... you are connected to the VNC-Server running by GnuRoot Debian. Have fun... I installed LibreOffice and Gimp as desktop solution. Working great with the Halo keyboard and with a bluetooth mouse
Does the keyboard work?
boofman said:
Does the keyboard work?
Click to expand...
Click to collapse
Yes. Halo Keyboard works, as well as the touchpad. It simulates a "right click" of a mouse by touching the pad with two fingers. But i can't recommend using the touchpad. I use a Bluetooth mouse, and it works well with GnuRoot. You can work just like with a normal Linux environment.
Furthermore I got Libreoffice, GIMP, Firefox ESR and Evince (pdf-Reader) working. Unfortunately i didnt get Chromium (32-bit) working.
ok what about the wacom pad i.e. the create pad itself? does it work in linux?
Okay, so it works similar to a Virtualbox, but is more lightweight as it uses the Linux system that's running behind android in principle, right? Well, it makes the Android YB much more better than the Windows variant if that's the case, as it makes it a lot easier to use a real desktop environment inside of Android without having to reboot..
I'm weighing the pros and cons of going through all these trouble though, as the only reason I would want to have a linux desktop running would be more about using Office apps more than anything, and now with MS Office for Android, that would shorten the gap. I love Linux and have a Mint dual boot on my other machine, but the advantages in using the YB ultraportable Android with MS Office should suffice..
@bisharat:
I tried the wacom pad within linux using gimp. but it recognizes the pen only as normal mouse input. sometimes it lags, so drawing (on a professional base) doesn't work that well. and: in linux the pressure used with the pen (i.e. the intensity of the drawn line) isn't recognized as well.
@boofman:
The reason why i installed a linux system on the yoga book was: i tried every reasonable office solution in the app store or other sources, but i haven't found one that can work offline and which can work nearly as good as LibreOffice. As i have to read a lot of Magazines / Journals and as i have to write a lot of papers and making presentations, the installed linux system sufficed as Office solution.
And i plug in an external monitor (if needed) through the mini-hdmi, so i can have a light-weight mini office computer upon my android system for work. I think this is a good alternative, as I still don't see any possibilities to dual boot this device (aka Android and Win10).
-- message deleted --
ok so if possible can u post a video on how to install it and how to uninstall it (in case anything goes wrong)?
bisharat said:
ok so if possible can u post a video on how to install it and how to uninstall it (in case anything goes wrong)?
Click to expand...
Click to collapse
i just wrote a small tutorial in the first post. its similar to this tutorial:
https://www.xda-developers.com/guid...a-gnulinux-environment-on-any-android-device/
but i added some new commands.
uninstalling is very easy. just uninstall it through the application manager of the yoga book and delete the "GnuRoot" folder in your sdcard.
Tiggi2017 said:
@bisharat:
I tried the wacom pad within linux using gimp. but it recognizes the pen only as normal mouse input. sometimes it lags, so drawing (on a professional base) doesn't work that well. and: in linux the pressure used with the pen (i.e. the intensity of the drawn line) isn't recognized as well.
@boofman:
The reason why i installed a linux system on the yoga book was: i tried every reasonable office solution in the app store or other sources, but i haven't found one that can work offline and which can work nearly as good as LibreOffice. As i have to read a lot of Magazines / Journals and as i have to write a lot of papers and making presentations, the installed linux system sufficed as Office solution.
And i plug in an external monitor (if needed) through the mini-hdmi, so i can have a light-weight mini office computer upon my android system for work. I think this is a good alternative, as I still don't see any possibilities to dual boot this device (aka Android and Win10).
Click to expand...
Click to collapse
Thanks for the feedback.
Yeah, I can see where you are coming from, and as a matter of fact, I use my YB Android pretty much the same as you do: hook it up to a monitor and sometimes use it on a projector for presentations.
The issue I have with LibreOffice is that there are times the formatting gets messed up when opened in MS Office (where majority of my officemates use) unless saved in a PDF Format which you can't edit.
For now, MS Office for Android works though a bit lacking in features as compared to the Win10 version, but gets the job done in a pinch.
Dual-boot is one thing we can look into, but for now though, your solution is worth a try and should be a better option.
boofman said:
Thanks for the feedback.
Yeah, I can see where you are coming from, and as a matter of fact, I use my YB Android pretty much the same as you do: hook it up to a monitor and sometimes use it on a projector for presentations.
The issue I have with LibreOffice is that there are times the formatting gets messed up when opened in MS Office (where majority of my officemates use) unless saved in a PDF Format which you can't edit.
For now, MS Office for Android works though a bit lacking in features as compared to the Win10 version, but gets the job done in a pinch.
Dual-boot is one thing we can look into, but for now though, your solution is worth a try and should be a better option.
Click to expand...
Click to collapse
yeah, thanks. the thing with ms office is that you have to have an account the the features arent that superb. but you are right, most people use ms office and the format is messed up when continuing working with LibreOffice. thats why i only write documents and make presentations with LibreOffice. when publishing i always convert to pdf.
alternatively i also tried crossover with.... well... not so good results. its lagging and therefore disturbing the workflow. furthermore i just got Libreoffice working with crossover (more or less working...), gimp or other free graphic apps dont work.
having Linux on an Android system is a good way to have an Office computer in one's pocket. i also look forward to a possibility to dual boot the device.
deleted
Tiggi2017 said:
Hello community!
For those who are interested in installing a linux system (debian) without root:
I managed to install GnuRoot referring to this tutorial:
https://www.xda-developers.com/guid...a-gnulinux-environment-on-any-android-device/
At first i had graphical errors when starting LXDE (like missing icons) due to missing libraries during the installation process.
I show you the steps for installing it, referring to above tutorial, but i added some new terminal commands, because there were libraries and dependencies missing when installing LXDE.
1) First install GnuRoot and XSDL server from playstore.
2) Let GnuRoot start and doing its installation. Then type in following terminal commands:
apt-get update
apt-get upgrade
dpkg-reconfigure tzdata <----- if you wanna change your locales
apt-get install libffi6 <------ this is one of the missing libraries, otherwise LXDE will have errors during its installation
apt-get install execstack <------ this is one of the missing libraries, otherwise LXDE will have errors during its installation
execstack -c /usr/lib/i386-linux-gnu/libffi.so.6 <------ this is one of the missing libraries, otherwise LXDE will have errors during its installation
apt-get install lxde-core <------- alternatively apt-get install lxde (for full LXDE with its apps)
3) start XSDL and make your configs (resolution etc.), let it run in the background
4) now type in GnuRoot following terminal commands:
export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4712
startlxde &
5) switch back to XSDL and then wait until the GUI (aka LXDE) starts
It still shows some bugs like "No Session for PID # xxxx" whenever i log in. So i hope that i can get help to install it better (correctly) from the community.
Click to expand...
Click to collapse
Edit: I see that it's via an Android device. Never mind
Was this done on the Android version or the Windows 10 version of the Yoga Book? Because this may be the breakthrough of getting Android on the Windows 10 version, and then enabling me to do research with a custom ROM.
Yoga Android: "It still shows some bugs like "No Session for PID # xxxx" whenever i log in. without the possibility to close the message windows." smae as the starter herein. anyone else? how to solve that?
s01q said:
Yoga Android: "It still shows some bugs like "No Session for PID # xxxx" whenever i log in. without the possibility to close the message windows." smae as the starter herein. anyone else? how to solve that?
Click to expand...
Click to collapse
For me, i can close that error message. But it is still annoying and i cannot get rid of that.
@nan0s7
Unfortunately it is for the android device only. Still waiting for a possibility to dual boot the device. I hope for a breakthrough soon....:fingers-crossed:
Tiggi2017 said:
For me, i can close that error message. But it is still annoying and i cannot get rid of that.
Click to expand...
Click to collapse
stupid me. Can close it
Tiggi2017 said:
@nan0s7
Unfortunately it is for the android device only. Still waiting for a possibility to dual boot the device. I hope for a breakthrough soon....:fingers-crossed:
Click to expand...
Click to collapse
Hope so... this device has so much potential =D
nan0s7 said:
Hope so... this device has so much potential =D
Click to expand...
Click to collapse
but then dual boot with linux or HaikuOS
s01q said:
but then dual boot with linux or HaikuOS
Click to expand...
Click to collapse
I'm aiming for Android first ;P

Categories

Resources