[GUIDE] Full bash shell with nano, tab completion, and color over ssh and adb - EVO 4G Android Development

Posting this here because I think it will be of more interest to the tinkerers/devs than general users, if not, feel free to move it. I cobbled all of this together from various places on the web, but I think the credit for the binaries goes to Paul @ MoDaCo.
Nandroid before going any further!
Files you'll need:
For WiFi and CDMA SSH access - QuickSSHD (Download this from the Market. $1.50). I'm just going to assume if you're still reading, you know what this is for and how to use it. It's braindead simple. I think dropbear can be installed and configured manually, but for the $1.50...meh.
adb for tethered access.
The rest are zipped up here: terminfo, nano, bash, profile**
Unzip bashnano.zip onto your SDCard.
adb remount
From adb shell:
Install Terminfo:
cp -r /sdcard/terminfo /system/etc
Setup Bash:
cp /sdcard/bash /system/bin/bash_new
mv /system/bin/sh /system/bin/sh.old
ln -s /system/bin/bash_new /system/bin/sh
mv /sdcard/profile /sdcard/bash_profile (Thanks to jjvcuyler for finding adb bash profile location.)
Setup Nano:
cp /sdcard/nano /system/bin
I'm not sure if this setup will have any impact on sh scripts being used in the various ROMs, so use this at your own risk. I think it would kick ass to see this type of bash functionality baked into the custom ROMs.
If anybody would like to make this a flashable.zip, please do. I don't know how to do that yet.
Anyway, hope y'all find it useful.
**profile reflects a few personal choices for aliases and colors, but you can edit to your personal taste.

So I just did this. Is there any way to get this functionality into a local terminal?
Also I was able to do everything from a local terminal without adb. Just do the following first:
su
remount rw
Click to expand...
Click to collapse

adb shell fires off bash, but it doesn't read profile from /etc. It's going to be a simple matter of figuring out where bash is looking for it. I just haven't found that out yet.
How do you like having full bash capabilities on EVO? Arrows/tab completion/color prompts, etc...
J

jmxp69 said:
adb shell fires off bash, but it doesn't read profile from /etc. It's going to be a simple matter of figuring out where bash is looking for it. I just haven't found that out yet.
How do you like having full bash capabilities on EVO? Arrows/tab completion/color prompts, etc...
J
Click to expand...
Click to collapse
Copy profile to /sdcard/bash_profile

jjvcuyler said:
Copy profile to /sdcard/bash_profile
Click to expand...
Click to collapse
WooT! There it is. I'll update the OP. Thanks jjvcuyler.
Edit: /sdcard/bash_profile works for ssh and adb. OP updated to reflect the change.

jmxp69 said:
Posting this here because I think it will be of more interest to the tinkerers/devs than general users, if not, feel free to move it. I cobbled all of this together from various places on the web, but I think the credit for the binaries goes to Paul @ MoDaCo.
Nandroid before going any further!
Files you'll need:
For WiFi and CDMA SSH access - QuickSSHD (Download this from the Market. $1.50). I'm just going to assume if you're still reading, you know what this is for and how to use it. It's braindead simple. I think dropbear can be installed and configured manually, but for the $1.50...meh.
adb for tethered access.
The rest are zipped up here[/URL]: terminfo.zip, nano, bash, profile**
Unzip bashnano.zip onto your SDCard.
Unzip terminfo.zip (from inside bashnano.zip) onto your SDCard.
adb remount
From adb shell:
Install Terminfo:
cp -r /sdcard/terminfo /system/etc
Setup Bash:
cp /sdcard/bash /system/bin/bash_new
mv /system/bin/sh /system/bin/sh.old
ln -s /system/bin/bash_new /system/bin/sh
mv /sdcard/profile /sdcard/bash_profile (Thanks to jjvcuyler for finding adb bash profile location.)
Setup Nano:
cp /sdcard/nano /system/bin
I'm not sure if this setup will have any impact on sh scripts being used in the various ROMs, so use this at your own risk. I think it would kick ass to see this type of bash functionality baked into the custom ROMs.
If anybody would like to make this a flashable.zip, please do. I don't know how to do that yet.
Anyway, hope y'all find it useful.
**profile reflects a few personal choices for aliases and colors, but you can edit to your personal taste.
Click to expand...
Click to collapse
there is no terminfo.zip and there is nothing in terminfo directory from within the original zip... help?

Sorry, I missed the recurse flag zipping the terminfo directory. It's fixed now. Go ahead and re-download.
Here's a link for just terminfo.zip
J

I modified the bash_profile to get rid of the colors since the window's cmd.exe doesnt support ansi colors. probably a better way to do this but it works for me.
also found this useful for setting PS1 to my liking http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

jmxp69 said:
adb shell fires off bash, but it doesn't read profile from /etc. It's going to be a simple matter of figuring out where bash is looking for it. I just haven't found that out yet.
How do you like having full bash capabilities on EVO? Arrows/tab completion/color prompts, etc...
J
Click to expand...
Click to collapse
is there a way to get tab completion through adb shell?

Yes. This works with adb shell. Just follow the directions in the OP.

jmxp69 said:
Yes. This works with adb shell. Just follow the directions in the OP.
Click to expand...
Click to collapse
i have and i do have everything done as stated in the OP, when i try tab completion via adb shell (phone tethered with usb) from my pc, it just puts in a tab, it doesn't complete.

Hmm....could be a dos thing with cmd.exe. I haven't tried on a PC, I'm on a Mac. adb shell via OSX works fine with tab completion. Try ssh'ing in instead with something like putty? Once you get ssh going, you don't need a cable.
Edit: Confirmed...tab completion doesn't work over Win cmd.exe and adb shell.

jmxp69 said:
Hmm....could be a dos thing with cmd.exe. I haven't tried on a PC, I'm on a Mac. adb shell via OSX works fine with tab completion. Try ssh'ing in instead with something like putty? Once you get ssh going, you don't need a cable.
Edit: Confirmed...tab completion doesn't work over Win cmd.exe and adb shell.
Click to expand...
Click to collapse
Thanks for looking into it... I'll try getting it to work via linux instead. I guess ssh would be a solution, but i never turn wifi on.

Is anyone able to do a NAND backup/restore after doing this? With Amon Ra's recovery I was unable to NAND backup.
EDIT:
I think this is a big negatory. I was just able to do a NAND backup, so maybe the error I got was a coincidence after applying these changes.

Anyone else noticing that the time is always displayed as GMT in the prompt? The date command gives the correct time for my timezone but the bash prompt always shows GMT

Vinny75 said:
Anyone else noticing that the time is always displayed as GMT in the prompt? The date command gives the correct time for my timezone but the bash prompt always shows GMT
Click to expand...
Click to collapse
Change PS1 line: \A to `date +%H:%M`

jmxp69 said:
Posting this here because I think it will be of more interest to the tinkerers/devs than general users, if not, feel free to move it. I cobbled all of this together from various places on the web, but I think the credit for the binaries goes to Paul @ MoDaCo.
Nandroid before going any further!
Files you'll need:
For WiFi and CDMA SSH access - QuickSSHD (Download this from the Market. $1.50). I'm just going to assume if you're still reading, you know what this is for and how to use it. It's braindead simple. I think dropbear can be installed and configured manually, but for the $1.50...meh.
adb for tethered access.
The rest are zipped up here: terminfo, nano, bash, profile**
Unzip bashnano.zip onto your SDCard.
adb remount
From adb shell:
Install Terminfo:
cp -r /sdcard/terminfo /system/etc
Setup Bash:
cp /sdcard/bash /system/bin/bash_new
mv /system/bin/sh /system/bin/sh.old
ln -s /system/bin/bash_new /system/bin/sh
mv /sdcard/profile /sdcard/bash_profile (Thanks to jjvcuyler for finding adb bash profile location.)
Setup Nano:
cp /sdcard/nano /system/bin
I'm not sure if this setup will have any impact on sh scripts being used in the various ROMs, so use this at your own risk. I think it would kick ass to see this type of bash functionality baked into the custom ROMs.
If anybody would like to make this a flashable.zip, please do. I don't know how to do that yet.
Anyway, hope y'all find it useful.
**profile reflects a few personal choices for aliases and colors, but you can edit to your personal taste.
Click to expand...
Click to collapse
I followed the steps exactly, but end up with "- exec '/system/bin/sh' failed: Permission denied (13) -" while typing "adb shell" in a windows or linux terminal. I cannot recover the original sh because the root is lost, and I cant root my phone anymore probably because something wrong with the new sh. Any idea how to fix this?
EDIT: Acutally nevermind. adb shell works in recovery mode. but still, not sure why the modified sh doest work for me

The Downloadlink is dead!
So the thread is useless.

francwalter said:
The Downloadlink is dead!
So the thread is useless.
Click to expand...
Click to collapse
Yeah.....no.
A simple google search would have shown you that the files are here: http://66.197.42.222/bashnano.zip
or here http://androidforums.com/attachment...ide-installing-bash-nano-android-bashnano.zip.
EDIT: I've also attached it in case the links above ever die, there will still be one which does not.

ya this is great and all but any decent busybox installer will setup bash for you.

Related

Solved - Change root password

I used the directions from Jesus Freke to install the Mod RC30 on my G1.
Then I read and used the instructions provided by Stericson to change my password....
Only one problem! Now it won't let me access root with su or with my password. I wanted to use something generic first and if it was successful I would change it to a good password. So, I used my user name "shaneaus"
Now I get permission denied with both su and shaneaus!
Am I totally screwed? Is there some way to reset the password back to su. That wouldn't make sense, I know, from a security sense. Just hoping.
Thanks
I'm hoping that there is an easier solution.
But, if I flash the update... Will that reset the root password?
I don't know what happened but this can be remedied. First off, it is possible that when you change the superuser command you failed to chmod it to 4755...at any rate, you can solve this by plugging your phone into your computer and starting up an adb shell, this should give you root if you have the modded rc30. Next remount /system to read and write privileges
mount -o remount,rw /dev/block/mtdblock3 /system
now type:
cd /system/bin
ls
Do you see su or your username listed?
If so type:
chmod 4755 (type su or your username here, without parantheses)
now open terminal emulator on your phone and try your superuser command again.
If you did not see su or your username in the output of ls type the following to get a setuid shell:
cat sh > (username or su whichever you want)
chmod 4755 (username or su whichever you want)
now open terminal emulator on your phone and try your superuser command again.
That should get you going.
Ha!
I'm just beginning to learn how to do this stuff. I have no idea how to "start up an adb shell" or even what an adb shell is!
So, I guess I'll start researching on line!
Ok, so I've read up on the adb shell and think I have a grip on how to use it... Except I can't figure out how to get the darn thing started. Do I have to open up the emulator? I thought I would be accessing the device - not the emulator. But, most sites talk about using the adb with the emulator. Also, I have seen where I should be able to run adb devices.exe and have it show my device to confirm it is connected. Only one problem, I can't find the adb devices.exe in the sdk kit.
Oh, and thanks again to Jesus Freke for the 64bit USB drivers. worked like a charm!
Awesome! Y'all are fantastic! I learned a lot tonight! I did the following:
Add $SDK_ROOT\tools to my path
Then had a hell of a time because everything I was reading (except for one location I finally found said to run "adb shell.exe"
I finally found a site that said to run "adb.exe shell"
And, whalla! I was in.
Your above advise was spot on, Stericson! Thank you!
Glad to hear you got it sorted.
shaneaus said:
Oh, and thanks again to Jesus Freke for the 64bit USB drivers. worked like a charm!
Click to expand...
Click to collapse
*looks around* huh? me?
I assume you're refering to this driver?
You should be thanking aziwoqpd for that, not me

Terminal commands

Is there a list somewhere for the commands because i tired to do the "dir" to get a list of files in the folder but it work. (on terminal or adb shell).
* Also what is the best file manager? Is there anything that has a password so that other people cant get into it?
'ls' is the unix command to list contents in a folder
Ok thanks. just been a long time since i messed with Linux shells i guess i should get my books out and start reading again
Android's Linux commands
although he got the wrong command for list files, he raises a good point, the android linux is far from having all commands other linux system have - does anyone have these documented somewhere? what it has and what it doesn't have?
eladkatz said:
although he got the wrong command for list files, he raises a good point, the android linux is far from having all commands other linux system have - does anyone have these documented somewhere? what it has and what it doesn't have?
Click to expand...
Click to collapse
if you are running jf 1.31 then you have busybox installed.. google busybox and you will find out all the terminal commands you can run from your phone terminal or over adb shell.....
eladkatz said:
although he got the wrong command for list files, he raises a good point, the android linux is far from having all commands other linux system have - does anyone have these documented somewhere? what it has and what it doesn't have?
Click to expand...
Click to collapse
ls /system/bin
ls /system/xbin
ls /system/xbin/bb
that should give you a fairly complete listing of the commands available.
korndub said:
if you are running jf 1.31 then you have busybox installed.. google busybox and you will find out all the terminal commands you can run from your phone terminal or over adb shell.....
Click to expand...
Click to collapse
I just noticed this myself. I need to remove a symbolic link and recreate it by "unlink" and "rm" dont' seem to work. Is there a busybox command that will do it?
A quick google search brought up this annotated list for those new to these commands:
http://www.busybox.net/downloads/BusyBox.html
JF Thanks for that, I was looking for that folder earlier and could not find it for the life of me. Blame it on drowsiness ...or just plain not wanting to be at work.
That list is only valid for modified Android. Stock Android runs toolbox, which has a much neutered list. Aside from JF's method, you can also look at the tpolbox links in update-script of an official update.zip
Hmmm.. does this mean overclocking is possible? Not that we "REALLY" need it right now but.....
adjtimex [-q] [-o offset] [-f frequency] [-p timeconstant] [-t tick] Read and optionally set system timebase parameters. See adjtimex(2).
Options:
-q Quiet
-o offset Time offset, microseconds
-f frequency Frequency adjust, integer kernel units (65536 is 1ppm)
(positive values make clock run faster)
-t tick Microseconds per tick, usually 10000
-p timeconstant
If you read any manpages on the command you would see that it's for correcting system clock drift.
If you type in "busybox" (without quotes) it will give you the list of commands. Enter "<enter command here> -d" for a description of the command you entered. Hope this helps...
"busybox --help" anybody? i thought the bb we had on our androids was not supposed to be the full busybox?
File manager
The Best file manager i found
https://play.google.com/store/apps/...lt#?t=W251bGwsMSwxLDEsImNvbS5yaG1zb2Z0LmZtIl0.
ha root explorer as well...
ca use app lock to protect it!

Ash as login shell

Hi All,
The Ash shell provides a few advantages over the Android default sh shell such as command history and cursor handling at the prompt. There are other benefits, but these are the first that come in most handy (to me).
The following tutorial will get you ash as the login shell with as yet no ill effects:
Note: that in my case, I'm using my android2sd construct and thus this modification is being done to my active overlay profile setup, thus to undo it I can simply boot into "safe\\normal" mode and undo the changes without possibly locking me out of the console should it have failed (which it didn't) But you can edit the Android /system/bin/sh file in this manner directly.
Ash as Login Shell:
OK, make the /system fs read-write:
mount -o remount,rw /system
Click to expand...
Click to collapse
Note: that the fs type is not needed, and in my case is not yaffs but ext3, Android will figure it out proper.
Next,
cp -a /system/bin/sh /system/bin/sh0
Click to expand...
Click to collapse
(this is for backup purposes and allows us to undo the change if so desired, or delete it if no longer needed).
Note: I'm using JF1.51 roms, so busybox ash is available as /system/xbin/bb/ash, so that is what I am using here; use ash however you are able to access it.
echo "#!/system/xbin/bb/ash">/system/bin/sh
echo "/system/xbin/bb/ash \[email protected]">>/system/bin/sh
Click to expand...
Click to collapse
Please note the use of (redirect\\overwrite)> and (redirect\\append)>>.
This will overwrite sh with a script to load the desired shell, executing any command-line arguments passed, and preserve the permissions of the original sh file. You can manually set the permissions the same as they are for our sh0 backup if the permissions (root.shell)(0755) don't seem to keep.
Finally reset the read-only state of /system:
mount -o remount,ro /system
Click to expand...
Click to collapse
Now if you shell-in\\telnet-in you should get the ash prompt which unlike the Android sh default prompt, includes the present working directory(pwd) ie: '/#' instead of just '#'.
Note: A reboot should not cause the loss of the modification, but if does, copy the new sh script to your /data/local/bin location or something and copy it back via boot script or something.
Shell Scripts:
If you're like me, you discovered that Android didn't need the interpreter declaration comment in scripts, and thus may not have used them...Well, you will need to update your scripts to include them by adding something similar to the following as the first line of your scripts:
#!/system/xbin/bb/ash
Click to expand...
Click to collapse
Again, please note that I am using JF1.51 roms and the location of the busybox ash shell is what I'm listing; put the full location to the shell you intend to use as this location.
Without the interpreter declaration, ash simply complains 'not found' at the first command, as ash doesn't know how to interpret the script, and doesn't seem to default to the login shell.
Hope someone finds this helpful!
sweet. This is going to be very useful
BAM. thats sexy. i just did this on CM3.6.7.1. works like a charm.
scratches head. i'm lost. what does this do and how does this make my g1 better?
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
im not sure about the other features, but the one i installed it for is to have your working directory in front of ur prompt. ex:
Code:
/# cd /sdcard
/sdcard # cd /system/sd
/system/sd #
etc...
EDIT: Also, if you use ConnectBot, you'll notice with the regular sh, if u scroll up with tracball, you get BS characters on the prompt. with THIS one, when you scroll up, you get last command entered. VERY handy for when you mistype one character on a long-ass command.
I love you
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
great job, i'm going to get ash working on my G1 (CM-3.6.7.1)
Thanks.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
I tried this and it worked even after a reboot...
Sweet, I love the scroll back with trackball in the terminal!!! Me thinks this should get absorbed into the next Cyan release.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
Yes, I reckon you could. Though I had done a few experiments where the symlink failed, but I'm fairly sure it was do to the link: /system/xbin/bb/ash -->../busybox and /system/bin/../busybox not existing...so I did it via script. Many ways to skin a cat they say.
Thank you all... this is fricken awesome!!
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
It gives a more advanced shell for when you use the command line interface or telnet into your G1. If you don't use the command line a lot, it won't help you.
As for specific benefits to the advanced version, it was listed in the first post.
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Seems to work fine on Dude's. Not really sure how it should open, but I type "ash" at the prompt and I get the /$ and /# if superuser. I also get the command history by rolling the trackball, which is a very nice feature.
Can i install this without using my PC?
temporizer said:
Can i install this without using my PC?
Click to expand...
Click to collapse
Should work using terminal.
Tried it on JACHero 2.7.1
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
mugafuga said:
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
Click to expand...
Click to collapse
Do this first before the mv and the symlink.
mount -o remount,rw /system
farmatito said:
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Click to expand...
Click to collapse
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Load ash when terminal is started?
temporizer said:
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Click to expand...
Click to collapse
Safest method will be to change to ash shell once terminal app is started (same as typing "ash" to switch shell from sh to ash). I don't know how to do it in android (in linux you could add it to your login script).
So if someone knows how to execute a command when we login using the terminal app, then switching to ash shell would work without fear of breaking any other functionality.

[PROGRAM] nano editor for android

For the vi haters!!!
Attached you will find a static compiled version of the nano editor (http://www.nano-editor.org/).
To install:
Code:
adb remount
adb push nano /system/bin/
adb shell
chmod 755 /system/bin/nano
chown root.shell /system/bin/nano
That's it.
Works fine in androids terminal (tested in CM-mod 4.0.4).
Seems not to work in adb shell due to the Ctrl key not working correctly.
Should work over SSH or telnet (untested).
Enjoy.
Thanks for this, I never liked vi much.
awesome
This is awesome ... Ima gonna test ...
maybe throw it in my ROM's.
Sweet. Thanks a ton!
~enom~
I am not that familiar with linux and other unix operating systems and have ran into vi on different shells and whatnot and don't like it. I posted in the apps section about a decent text editor but never found one.
Basically, I have used vi and don't like it. I am just not familiar enough with linux to have used nano, how do I go about using this?
I assume I would be safe to google it and they way it is normally ran via linux would work, if not though, what is different?
It's a lot like Dos edit but better, just look at the GUI.
Well to me anything is better then vi, I will surely give it a try.
Thanks for your time and effort.
bash-3.2# vi /www/forum/post/dream/dream-android-devel/post4482405/reply7.txt
i Finally, a decent, usable commandline text editor for the android.
I really was getting tired of the old shell, now we have BASH. I was getting tired of vi, now we have nano. :wq!
bash-3.2# cat ~/.signature
Doesn't work on Milestone; it needs a terminfo file, fails to find it in /etc, bails out.
Elsewhere people suggested setting TERMINFO and TERM environmental vars before running nano, but that won't help, as "find / -name terminfo" shows there's no such file in Milestone userland.
Hm. A little thinking helps:
Code:
adb push /etc/terminfo/l/linux /data/local/etc/terminfo/l/linux
and then, nano happily starts after
Code:
export TERMINFO=/data/local/etc/terminfo
export TERM=linux
(I recommend installing busybox first, if you haven't done that yet.)
Cant use it.
Keeps saying:
Error opening terminal: unknown
I tried this program a while back ago (hefty for android, but still) since I like it better than vi (I'm not THAT spartan). However, if I remember right, I couldn't figure out how to (^X) or (^anything), and that is pretty important, right?
Do we have a sort of list of commands that were modified for the Dream's keyboard?
jubeh said:
I tried this program a while back ago (hefty for android, but still) since I like it better than vi (I'm not THAT spartan). However, if I remember right, I couldn't figure out how to (^X) or (^anything), and that is pretty important, right?
Do we have a sort of list of commands that were modified for the Dream's keyboard?
Click to expand...
Click to collapse
Depends on your terminal emulator. In ConnectBot, press the trackball once for CTRL (twice for ESC). The key is sticky, so you don't have to hold it down.
Guess it doesnt work for wg kernel.
tried to make it work but doesnt =/
Macrophage001 said:
Cant use it.
Keeps saying:
Error opening terminal: unknown
Click to expand...
Click to collapse
Use the export commands in the post above yours. Update the terminfo one to wherever you have terminfo files. On SuperD they are already in /etc/terminfo. I think Cyanogen has them there as well. If you don't have them, you might have to put some in /system/sd from a Linux system.
As I use bash 99% of the time, I just put the commands in my bash_profile so they are already setup when I start the shell. Thanks to the OP. I was thinking I wanted nano just the other day. vi is powerful, but cryptic as hell and sometimes I just don't need the extra power.
If you are a termux user and want to install a nano or vi or any other binaries of termux in Andriod su mode. Here is the link to Termux superuser.
Give it a star if it was helpful !!!

[HOWTO] Guide to running ADB under Fedora 11 (and equivalent distros)

Ok, I have fedora 11 installed on most of my computers, since i love this distro to death. My big thing was trying to get adb to work. This is my guide to get it to work, for now.
First things first. Navigate to /etc/udev/rules.d as root. Create a rules file called 50-android.rules (touch 50-android.rules). NOTE: You are better off looking at the contents and picking a rules number set other than what is listed. Sometimes udev is picky. For the newbies, so if any rules start with '50', then change the number by one or two, like 51 or 52. Paste this into the file:
Code:
SUBSYSTEM=="usb",ATTRS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666"
Make sure you use ATTRS, not ATTR or SYSFS, since this is a newer updated udev system.
After that, run udevadm control --reload-rules to reload your rules files. Now just run ./adb devices as root to make sure it recognized your HTC dream. I am working on this fix right now so you don't need to be root, keep patient. Now you can adb shell into your device either as root OR normal user, just as long as you start the server as root. This is a permissions problem, and hopefully I can fix this and/or find a fix soon.
I wrote this because i searched high and low through google, and only found a few good parts as far as a fix. Hopefully this helps a few people out there.
Just wondering if this has helped anyone. If not, delete this thread or do whatever with it....
I have adb on my eeepc 900 with f11 I believe this method works too as well. although it says it has been tested with ubuntu, it works pretty well with f11.
http://www.talkandroid.com/android-sdk-install-guide/
Installing The Android SDK
First you will need to download the Android SDK pack .zip archive, once downloaded find a suitable installation location on your machine and extract the zipped files.
Please note: This installation location will be referred to as $SDK_ROOT from now on through this tutorial
Alternatively you can add /tools to your root path which will prevent the need to specify the full path to the tools directory along with enabling you to run Android Debug Bridge (adb) along with other command line tools.
To add /tools:
Linux
1. Edit the ~/.bash_profile or ~/.bashrc files looking for a line that sets the PATH variable.
2. Add the full path location to your $SDK_ROOT/tools location for the PATH variable.
3. If no PATH line exists you can add the line by typing the following:
4. export PATH=${PATH}:<path to your $SDK_ROOT/tools>
Click to expand...
Click to collapse
It helped me, since the creation of the file my OpenSuSE 11.0 recognizes the phone perfectly
Thanks a lot for your hint.
thanks it helped me. ill be looking forward to getting it to work without root
just use sudo instead
Just a heads up for user's using Ubuntu 9.10, this isn't needed. I connected my G1 to it and ran ADB with no adjustments to udev or anything else.
Pretty much it works out of the box.
Here is my version
download the .tgz file from googlecode
http://developer.android.com/sdk/index.html
sudo tar -xzvf android-sdk_r3-linux.tgz
Click to expand...
Click to collapse
Code:
sudo gedit ~/.bash_profile
heres my bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH=$PATH:/android-sdk-linux/tools
Click to expand...
Click to collapse
logout
login
connect android g1 device via usb to pc
open a terminal
Code:
adb devices
if you cant get a device try it with superuser.
Don't you think that this is all just a little bit excessive?
To make it work in F11, just do this;
Download SDK, extract.
To use, type:
/path/to/sdk/tools/adb
Another option is to edit the /etc/profile and add
PATH=$PATH:/<Path to android-sdk>/tools
This option will allow any user to use the adb tools when logged in or if you
su -
into another user
I wrote a short guide as well for Windows and Ubuntu. Might help others.
Unfortunately, as anyone with a passing acquaintence with ADB knows, the scrolling issue can be a killer. I swear the other day I pressed "up" twice and it composed "rm /sdcard/rootfs.img /sdcard/system.ext2" and executed it. We run Android on our SD's btw.. Was not cool. Instead, I use ADB via telnet and it works beautifully. Here's how:
Code:
adb shell telnetd &
adb forward tcp:9999 tcp:23
Now type this: "telnet localhost 9999"
Enter "root" and hit enter
Finally update PATH: "export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin"
Okay, so 4 lines to enter and you have a "regular, sane" shell connection to the phone and you can actually scroll through history and text without it jumbling the text and executing random code. Enjoy.
lbcoder said:
Don't you think that this is all just a little bit excessive?
To make it work in F11, just do this;
Download SDK, extract.
To use, type:
/path/to/sdk/tools/adb
Click to expand...
Click to collapse
that works too as well but i would rather open up a terminal and type
sudo adb devices
sensimila said:
that works too as well but i would rather open up a terminal and type
sudo adb devices
Click to expand...
Click to collapse
WHY would you want to make it *MORE COMPLICATED*??
There is NO NEED for root.
/path/to/adb ...
THATS ALL.
This is kind of funny... i wrote this because i had trouble with it, so i am just sharing my fix...
In case this is interesting to someone:
The fix mentioned in the first post has to be applied to open SuSE x86 and x64 edition to make the G1 work. The external device works without it, but not the adb device.
Thanks again!
Just wanted to come and post that this does work with OpenSUSE 11.2 x86. Did this hoping to get adb to work with my LG Ally and it does. Thanks!
(Still) works for me on 64bit SUSE 11.4.
Before adding this file, I could not access my device with adb, received permissions errors.
Added this file, and I can shell into my device.
Permissions on adb itself was not the problem, it was access to the device when udev found it.
[edit]Actually used the lines from http://developer.android.com/guide/developing/device.html[/edit]

Categories

Resources