Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,772,773 Members 52,191 Now Online
XDA Developers Android and Mobile Development Forum

ADB enhanced Putty (replacement for "adb shell" command)

Tip us?
 
sztupy
Old
(Last edited by sztupy; 8th October 2010 at 11:58 PM.)
#1  
sztupy's Avatar
Recognized Developer - OP
Thanks Meter 855
Posts: 1,054
Join Date: Dec 2008
Location: London

 
DONATE TO ME
Smile ADB enhanced Putty (replacement for "adb shell" command)

We all know that running "adb shell" from the command line is pretty crap, and when using a latter busybox version which has coloring support it's ultimately crap. One workaround was usually to start a telnet server on the phone, and use putty to connect to that telnet server. Actually there is a more easier way to do that which also works for non rooted phones.

Actually the Android Debug Bridge has a terminal connection feature (roughly speaking), which will be enabled after you connect to the adb server in "0006shell:" mode. You can actually use the putty to connect to this interface always, by setting the following things:
- Turn off line discipline in settings
- Use RAW mode to connect to localhost:5037
- Enter "0012transport-usb" (without quotes)
- Enter "0006shell:" (without quotes)

Now you've got a full fledged connection to your device. The main drawback is that it's tedious to repeat the above all the time, so I've made some modifications to the putty binary that adds a new type of connection, called "Adb"

To use the enhanced putty:
- Select Adb from the connection type list
- Enter "transport-usb" in the host (or any other connection string, check the adb socket interface documentation if you need something else than connecting via usb)
- Enter 5037 as port, if it's not already set there.
- Connect and enjoy (you might also save this connection, so next time you only have to double-click on the settings)

DL and source: http://github.com/sztupy/adbputty/downloads

Screenshot:
Attached Thumbnails
Click image for larger version

Name:	putty.jpg
Views:	19211
Size:	34.4 KB
ID:	415809  
The Following 24 Users Say Thank You to sztupy For This Useful Post: [ Click to Expand ]
 
Namuna
Old
#2  
Namuna's Avatar
Senior Member
Thanks Meter 91
Posts: 492
Join Date: Jan 2010
Location: New York

 
DONATE TO ME
Thanks for this sztupy! I had scripted out connecting to my N1 via putty, but lost the scripts.

I just tried connecting using your tweaked putty, but got an error. Here're a couple screenshots to show how I tried to connect and the issue I had.
Attached Thumbnails
Click image for larger version

Name:	puttySettings.gif
Views:	1661
Size:	24.2 KB
ID:	415787   Click image for larger version

Name:	gethost.gif
Views:	1251
Size:	10.8 KB
ID:	415788  
Current Phone: Samsung Galaxy Note 3 (SM-N900A)
Case: Trident Cyclops w/TechMatte HD Clear Screen Protector
Carrier: AT&T
ROM: Stock 4.3, rooted
Kernel: Stock
Int Storage: 32gb
Ext Storage: AData Premiere 64GB UHS-I/Class 10

__________________________________________
There is no "Truth", only perception and deception
 
sztupy
Old
#3  
sztupy's Avatar
Recognized Developer - OP
Thanks Meter 855
Posts: 1,054
Join Date: Dec 2008
Location: London

 
DONATE TO ME
Quote:
Originally Posted by Namuna View Post
Thanks for this sztupy! I had scripted out connecting to my N1 via putty, but lost the scripts.

I just tried connecting using your tweaked putty, but got an error. Here're a couple screenshots to show how I tried to connect and the issue I had.
The only place where it uses gethostbyname is while querying "localhost". I don't know why this fails. (maybe IPv6 related(?)...) I'll replace it to actually use "127.0.0.1"...
 
goulloux
Old
#4  
Member
Thanks Meter 4
Posts: 71
Join Date: Dec 2007
Hi there, just go an LG Optimus 2X, and I'm starting to play with it.
But as my linux skill is almost inexistant I do have a hard time
So I wanted to use your alternate putty, mainly for tab-completion, but it doesn't work.
Putty is working, but "tab" is just tabing ...
Read that's a server functionality ==> does it mean that I need to install something on my phone ?

Thx for your time
 
sztupy
Old
#5  
sztupy's Avatar
Recognized Developer - OP
Thanks Meter 855
Posts: 1,054
Join Date: Dec 2008
Location: London

 
DONATE TO ME
Quote:
Originally Posted by goulloux View Post
Hi there, just go an LG Optimus 2X, and I'm starting to play with it.
But as my linux skill is almost inexistant I do have a hard time
So I wanted to use your alternate putty, mainly for tab-completion, but it doesn't work.
Putty is working, but "tab" is just tabing ...
Read that's a server functionality ==> does it mean that I need to install something on my phone ?

Thx for your time
To have auto complete you need to have an auto-complete enabled shell on the phone. The default "sh" shell is very minimal (as usual phone users won't use it), so you need another one. Busybox's "sh" is actually "ash" which has all of the features you need. So to use this feature you have to have busybox installed (which is usually there if you have rooted your phone, or can be installed from market)

If you have busybox installed, then you have to run it's sh with "busybox sh" or "busybox ash". You'll get a new prompt with the new features.
 
Kierrok
Old
#6  
Senior Member
Thanks Meter 105
Posts: 357
Join Date: Feb 2011
Thanks for adb putty!

How can I configure Home and End keys?
 
notageek1212
Old
#7  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Sep 2011
Wink Putty replacement

Hi there,
I don't know how relevant my post is in the context of this thread but I just wanted to let everyone know that I came across a new free terminal "ClearTerminal" which seems to be good.
You can try this one out if you need a replacement for putty or any other terminal.
It's available at clearconnex.com/content/clearterminal

Have a good time
 
Euclid's Brother
Old
#8  
Euclid's Brother's Avatar
Senior Member
Thanks Meter 256
Posts: 894
Join Date: May 2011
Location: Dallas, TX

 
DONATE TO ME
I'm using the modified PuTTY above, which works great if there is only one device connected. Is there a way to specify a device# if you have more than one device connected?

Thanks,
Epic 4G Touch VeNuM EL13 beta (EK02 modem)
Acer Iconia A500 - Taboonay

Follow me on Twitter

Contact me on GTalk: euclidsbrother is my gmail contact
Donate to my Root Beer fund
 
d00mz
Old
#9  
d00mz's Avatar
Senior Member
Thanks Meter 22
Posts: 289
Join Date: Oct 2007
Location: North Texas

 
DONATE TO ME
Pretty sweet! How do you get the colors in the session? Mine is black & white only. Running CM7.1.
-d00mz

Google Nexus 5 running on AT&T
ROM: Stock
Kernel: Stock
Radio: Stock
Rooted with thanks to chainfire!!


Google Nexus 7 3G
ROM: 4.2.2
Kernel: [3G+Wifi][4.2.2] M-Kernel - mr1 by Metallice
Radio: 1231_0.10.0_1021



Samsung Galaxy Note for AT&T retired,
Samsung Galaxy Tab for AT&T retired,
HTC Inspire 4G for AT&T retired,
HTC Google Nexus One for AT&T retired,
HTC Tilt for AT&T retired
 
swishman
Old
#10  
Junior Member
Thanks Meter 1
Posts: 11
Join Date: Apr 2011
only colors ?
i think its the same ..

Tags
adb, command line, putty, shell
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes