[Q] Setting up aliases for shell commands - Desire Q&A, Help & Troubleshooting

Hello,
I have a question about linux shell command aliases in Android:
Is it possible to set up permanent aliases that can be used from both a terminal emulator on the device as well as ADB?
When I define an alias using adb, its gone as soon as I exit that session... but I would really like to have some permanent aliases for things I often use...
For example: "ls -la --color=never" is a bit tough to type everytime, but otherwise the color codes will screw up the adb shell output...
Any help appreciated!

Found a solution.
If anyone is interested:
Download bash posted in this thread: http://forum.xda-developers.com/showthread.php?t=537827
Adb push this bash to /system/bin, set permissions to 755 and symlink ./sh to ./bash...
Actually, instructions are all in the other thread
Then you can put your bashrc file to /sdcard/bash_profile, done!

It took me some searching but I found out how. Just add your aliases to the bottom of /system/etc/mkshrc

Related

ADB: Permission denied...no matter what i do!!!

OK...I'm beginning to think that rooting is not for me!!!! Getting a bit frustrated!!!
OK, so I installed SDK on my pc (Win XP Ver 2002 SP3), and I cannot get it recognize the device.
I tried the guide for dummies here on XDA, and I follow all the indications, server starts up, I can kill it too....but every time I try to run it I get:
"error: device cannot be found"
The line that I am writing is as follows:
Code:
c:\android-sdk-windows\tools>adb shell
and I get the error above.
When I try to see if devices are connected, and Use this:
Code:
c:\android-sdk-windows\tools>adb devices
I get:
"List of Devices attached", but there is no list!!!!!
But I can see the SDCARD from my computer....I can access the files...
Maybe I can try to pull instead of push, but I'm not sure how that would be written (line wise), not if will work.
BTW...I have never done anything like this on android....very new to this!!!!
umm.. HELP!!!
OK changed pc's,....on this one it does recognize the device, but does not allow me to push anything.....when i try:
Code:
adb push su /sdcard/su
I get adb: permissions denied
------
I tried su +, and that got me to the # prompt. So I tried typing
Code:
# adb push su /sdcard/su
and I get adb: not found???
Running out of options here!
...
Thanks!
I think you are mounting the sdcard. You don't want to do that. Just connect your phone to the computer and run ADB. Don't click "USB Connected. Select to copy files to/from your computer" on your phone.
funkeee said:
I think you are mounting the sdcard. You don't want to do that. Just connect your phone to the computer and run ADB. Don't click "USB Connected. Select to copy files to/from your computer" on your phone.
Click to expand...
Click to collapse
Funkeeeeeee thank you for the reply.
OK...I am not getting an option when I connect to the pc..on the one I get it, I shose do nothing. I have also disabled mass storage on the device once loaded, adn I get the same error. Here is some of the code that I get thorught the PC's terminal:
C:\>cd android-sdk-windows\tools
C:\android-sdk-windows\tools>adb devices
List of devices attached
HT09YR200737 device
C:\android-sdk-windows\tools>adb shell
$ adb push su /sdcard/su
adb push su /sdcard/su
adb: permission denied
$ adb kill-server
adb kill-server
adb: permission denied
$
Click to expand...
Click to collapse
Notice that once I get the initial permission denied, the terminal seems to get locked up on that no matter what I type....see above...
Anything else to try??? AM I missing something here?
That's fine. There are a few things I can suggest for you to try..
First, I want you to enable USB debugging on your phone by going to Settings > Applications > Development and check that first option.
Then connect the phonoe, but don't use 'adb shell' before pushing files. It should look like this:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Funkz>cd c:\g2
c:\g2>adb pull /system/build.prop
501 KB/s (3596 bytes in 0.007s)
c:\g2>
Click to expand...
Click to collapse
If you are trying to run it from within adb shell, it will spit back 'adb: not found.' That should do fix it for you.
If it does not, go to Control Panel > System > Advanced > Environment Variables. Then click on Path and Edit, then ";C:\android-sdk-windows\tools\" at the very end and try again.
By the way, you don't have to run adb from the installation directory. After adding the path I just mentioned, you should be able to run it from anywhere.
funkeee said:
That's fine. There are a few things I can suggest for you to try..
First, I want you to enable USB debugging on your phone by going to Settings > Applications > Development and check that first option.
Then connect the phonoe, but don't use 'adb shell' before pushing files. It should look like this:
If you are trying to run it from within adb shell, it will spit back 'adb: not found.' That should do fix it for you.
If it does not, go to Control Panel > System > Advanced > Environment Variables. Then click on Path and Edit, then ";C:\android-sdk-windows\tools\" at the very end and try again.
By the way, you don't have to run adb from the installation directory. After adding the path I just mentioned, you should be able to run it from anywhere.
Click to expand...
Click to collapse
Thanks.....I finally can run it without having to type the entire path!!!! That was great help!!!
AS for the permission denied.....still having that issue! The one thing I didn't understand was when you changed the path to >g2.....what do you mean???? path to be g2?
Thanks again for the help!
Just a note...I am trying to do this post OTA, which I downloaded, never got the push...Would having the OTA have any effect on this? DO I need to consider reverting to stock and trying from there? If so how? run recovery?
Dude thanks for the help!
did you try typing SU? IMO you cant tamper with ADB Shell if you dont have su access so try typing down SU to ask for permission.
Alright first things first. ADB requires special drivers to work. Which is probably why it didn't work on the original PC. If you download the PDANet client on the PC that you need to do adb it will install the necessary drivers and you can uninstall the program without losing the drivers.
Another ADB requirement is to enable USB Debugging. MENU>Settings>Applications>Development and check the USB Debugging Box.
I don't know about anyone else but with my phone will automount the card. It is recommended to pull down the notification bar and make sure that your SD card isn't mounted.
You need to navigate your command prompt to whatever folder you keep ADB.exe for me
Code:
C:\Users\etnie>cd C:\Users\etnie\Downloads\G2\Android\tools
for me this returns
Code:
C:\Users\etnie\Downloads\G2\Android\tools>
to confirm this
Code:
C:\Users\etnie\Downloads\G2\Android\tools>adb devices
I won't post all the code but it should start the daemon successfully and list your device.
to be able to push files to your phone they also need to be in the same folder as the ADB.exe ie the tools folder. of course you can push it from any folder if you type the full path
Code:
C:\Users\etnie\Downloads\G2\Android\tools>adb push C:\Users\etnie\Downloads\G2\bootanimation.zip /data/local
the above code would push the bootanimation.zip from my G2 folder located in my Downloads folder to /data/local on the phone. changing the boot screen animation when you turn on the phone. I actually have the BIOS one. Because I am huge nerd lol. Moving on...
I think I covered everything necessary....If you are still having problems either PM me or reply here.
Thanks guys for the replays...here are some comments...
Acid_Wir3 said:
did you try typing SU? IMO you cant tamper with ADB Shell if you dont have su access so try typing down SU to ask for permission.
Click to expand...
Click to collapse
I have tried SU, and it does grant access, BUT!!!! so here is what happens...
I get to .....\tools> adb shell ... then i get.... the $ prompt. At this point I type $su .... then my prompt changes from $ to #. I understand that it should be $ # In any case once I get to # it says adb: not found code looks like this:
Code:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\carlos>cd\
C:\>adb shell
$ su
su
# adb push su /sdcard/su
adb push su /sdcard/su
adb: not found
#
BTW, the path has been predfined to C:\android-sdk-windows\tools\
Not sure how to navigate from #prompt
RuncaProfundus said:
1Alright first things first. ADB requires special drivers to work. Which is probably why it didn't work on the original PC. If you download the PDANet client on the PC that you need to do adb it will install the necessary drivers and you can uninstall the program without losing the drivers.
2Another ADB requirement is to enable USB Debugging. MENU>Settings>Applications>Development and check the USB Debugging Box.
3I don't know about anyone else but with my phone will automount the card. It is recommended to pull down the notification bar and make sure that your SD card isn't mounted.
4 You need to navigate your command prompt to whatever folder you keep ADB.exe for me
Code:
C:\Users\etnie>cd C:\Users\etnie\Downloads\G2\Android\tools
for me this returns
Code:
C:\Users\etnie\Downloads\G2\Android\tools>
to confirm this
Code:
C:\Users\etnie\Downloads\G2\Android\tools>adb devices
I won't post all the code but it should start the daemon successfully and list your device.
to be able to push files to your phone they also need to be in the same folder as the ADB.exe ie the tools folder. of course you can push it from any folder if you type the full path
Code:
C:\Users\etnie\Downloads\G2\Android\tools>adb push C:\Users\etnie\Downloads\G2\bootanimation.zip /data/local
the above code would push the bootanimation.zip from my G2 folder located in my Downloads folder to /data/local on the phone. changing the boot screen animation when you turn on the phone. I actually have the BIOS one. Because I am huge nerd lol. Moving on...
I think I covered everything necessary....If you are still having problems either PM me or reply here.
Click to expand...
Click to collapse
Runca thanks for the detailed reply....going in order here:
1 - I did and I still have pdanet isntalled
2 - it's been like that since the first day I got the phone.
3 - How do I ensure??? you are talking about from the phone....I should turn off USB Storage? Will try this one.
UPDATE: tried unmounting and re running without success....
Code:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\carlos>cd\
C:\>adb shell
$ adb push su /sdcard/su
adb push su /sdcard/su
adb: permission denied
$
4 - It's pretty much what I have. Other that I'm not running su before doing so......
Any thoughts?
Crey23 said:
AS for the permission denied.....still having that issue! The one thing I didn't understand was when you changed the path to >g2.....what do you mean???? path to be g2?
Click to expand...
Click to collapse
The "g2> " bit is just his command prompt. He's changed directory to one called "g2" on his phone but that's nothing to do with how adb works etc (just that if he pushes or pulls files then that'll be the current directory on the PC for that).
Crey23 said:
Code:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\carlos>cd\
C:\>adb shell
$ su
su
# adb push su /sdcard/su
adb push su /sdcard/su
adb: not found
#
Click to expand...
Click to collapse
Those "adb push" commands should be done from your PC's command prompt, not from within an Android shell prompt on your phone.
"adb shell" starts a command shell on the phone. Which is fine for doing some stuff. But "adb" commands won't work because now you're issuing them to your phone, not your PC.
steviewevie said:
Those "adb push" commands should be done from your PC's command prompt, not from within an Android shell prompt on your phone.
"adb shell" starts a command shell on the phone. Which is fine for doing some stuff. But "adb" commands won't work because now you're issuing them to your phone, not your PC.
Click to expand...
Click to collapse
Thanks Steve.....that makes a lot of sense, and in part why i am a bit lost here....but knowing that....how can I get to "push" things to my phone?
Don't run the adb shell command. That takes you into the phone's prompt. Any commands you run from adb shell with $ or # are run within the phone. You want to run adb push from command prompt. Look at my previous post. It should look like:
C:/>adb push ...
not
#adb push...
Sent from my HTC Vision using XDA App
Funkeee,x thank you I will try that as soon as I can.
funkeee said:
Don't run the adb shell command. That takes you into the phone's prompt. Any commands you run from adb shell with $ or # are run within the phone. You want to run adb push from command prompt. Look at my previous post. It should look like:
C:/>adb push ...
not
#adb push...
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
Sent from my T-Mobile G2 using XDA App
Finally progress
Guys thank you for your help!!!!!
I was finally able to push all the files to the phone. Now my problem has changed..., still dealing with Permission denied....when executing rage I get a buch of errors, please see image:
Code:
$ $su
# /data/local/tmp/rage
I get this.....
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I then figured that since I was temp rooted through Visionary r10, that was the reason for the errors above. I then proceeded to reboot without temp-rooting.
When I come up to the terminal I get:
Code:
export PATH=/data/local/bin:$PATH
$ $su
su: permission denied
$
SO if I understand this correctly, I need NOT be temp-rooted in order to run rage, but if I'm not temp-rooted, I don't have permissions to get to execute rage....there a chicken and egg story here somewhere! lol
Can I use a hybrid of the visionary temp root and perm root in that post?
From what I recall you need to uninstall visionary and reboot prior to using the rage method.
Sent from my HTC Vision using XDA App
Thanks funkeee...I will try in the morning.
But part of the problem is that without visionary I cannot get su access to run any of this. I'll backup VIS r10 before removing, and try again.
I post my results...goodnight and thanks!
funkeee said:
From what I recall you need to uninstall visionary and reboot prior to using the rage method.
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
Sent from my T-Mobile G2 using XDA App
I looked at the rage instructions and the prompt is misleading. You may forgetting to use chmod to change permssions. I've put my version of the instructions (just the start).
Uninstall visionary, reboot and from command prompt on your pc, navigate to the folder where you have these files and run:
c:/> adb push su /sdcard/su
c:/> adb push Superuser.apk /sdcard/Superuser.apk
c:/> adb push rage /data/local/tmp/rage
c:/> adb push busybox /data/local/tmp/busybox
c:/> adb push root /data/local/tmp/root
c:/> adb shell chmod 0755 /data/local/tmp/*
Don't forget the last entry, which changes the permissions.
Then on your phone, open terminal and put in:
$ /data/local/tmp/rage
It will say Forked Childs...
Then Menu > Reset Term. It will close, then launch terminal again, it will force close and then launch it again and you will have rage root.
If you get to there, you're in good shape. You can then follow those instructions to to push hboot and wpthis. Be careful with the dd command and be sure you have it exactly right. There are no do-overs with 'dd'.
http://forum.xda-developers.com/showthread.php?t=834228
Thanks man I will try it shortly.
funkeee said:
I looked at the rage instructions and the prompt is misleading. You may forgetting to use chmod to change permssions. I've put my version of the instructions (just the start).
Uninstall visionary, reboot and from command prompt on your pc, navigate to the folder where you have these files and run:
c:/> adb push su /sdcard/su
c:/> adb push Superuser.apk /sdcard/Superuser.apk
c:/> adb push rage /data/local/tmp/rage
c:/> adb push busybox /data/local/tmp/busybox
c:/> adb push root /data/local/tmp/root
c:/> adb shell chmod 0755 /data/local/tmp/*
Don't forget the last entry, which changes the permissions.
Click to expand...
Click to collapse
Up to here I am fine.
funkeee said:
Then on your phone, open terminal and put in:
$ /data/local/tmp/rage
It will say Forked Childs...
Then Menu > Reset Term. It will close, then launch terminal again, it will force close and then launch it again and you will have rage root.
If you get to there, you're in good shape. You can then follow those instructions to to push hboot and wpthis. Be careful with the dd command and be sure you have it exactly right. There are no do-overs with 'dd'.
http://forum.xda-developers.com/showthread.php?t=834228
Click to expand...
Click to collapse
But is with this part that I have issues with......
I uninstalled VISONary as suggested, and I got the same result as before.....error, error, error.....permission denied! Basically without visionary and su I cannot get access to the run rage. I gave me this error:
Code:
$ /data/local/tmp/rage
/data/local/tmp/rage: /data/local/tmp/busybox: permission denied
mount: Operation not permitted
mkdir failed for /system/xbin, Read-only file system
/data/local/tmp/rage: /data/local/tmp/busybox: permission denied
Unable to chmod /system/xbin/busybox: no such file or directory
/data/local/tmp/rage: /data/local/tmp/busybox: not found
cp: Permission denied
cp: Permission denied
Unable to chmod /system/xbin/su: no such file or directory
Mount: Operation not permitted
$
SO as i interpret this as I dont have the rights or permission to run the rage script. What puzzles me is the fact the it cannot "mount" the sdcard...after running this, I cannot take a picture (screenshot) bcs it does not recognize the sdcard. I have to Reboot.
Any ideas?
Thanks!
Crey23 said:
Up to here I am fine.
But is with this part that I have issues with......
Code:
$ /data/local/tmp/rage
/data/local/tmp/rage: /data/local/tmp/busybox: permission denied
mount: Operation not permitted
mkdir failed for /system/xbin, Read-only file system
/data/local/tmp/rage: /data/local/tmp/busybox: permission denied
Unable to chmod /system/xbin/busybox: no such file or directory
/data/local/tmp/rage: /data/local/tmp/busybox: not found
cp: Permission denied
cp: Permission denied
Unable to chmod /system/xbin/su: no such file or directory
Mount: Operation not permitted
$
Click to expand...
Click to collapse
I think there's something majorly wrong here. Funny, I saw someone else with a similar problem recently. It looks like when you're running "rage" it's actually running the "root" script that you use at a later stage, and not "rage" at all. Double check what you've got, I think "rage" is a binary and not a script. Are you sure you didn't push "root" to "rage" ?

[HOWTO] manual rooting of Galaxy Tab (EURO)

This howto is for those people who are unable to root their Galaxy Tab using any of the automated procedures and do not suffer from CLPS (command-line-phobia-syndrome).
My story: After upgrading my EURO (GSM) Galaxy Tab to JM6 my persistent efforts to root the device using either the z4root or SuperOnClick methods have all been unsuccessful. z4root (v1.3.0) kept crashing at different stages, apparently depending on which and how many background apps were running. With SuperOneClick I never managed to get beyond the "changing permissions" stage.
Since both methods are basically wrappers of the rageagainstthecage application, I tried to perform the rooting procedure manually. Guess what, that worked without any problem and it is pretty easy to do.
The basic steps of the rooting process are:
1) use rageagainstthecage to get a temporary root shell
2) use the temporary root shell to copy three files to the read-only system partition the device
While I find the outlined procedure straightforward, you may not. Anyhow, try this at your own risk.
==== Prerequisites ====
I used Ubuntu 10.10 for this, but it should work on any other distro and on Windows just as well. Whatever OS you use, you need a working adb connection to your Galaxy Tab. Odin or Kies are of no use here.
You need the following binaries
* su
* busybox
* Superuser.apk
* rageagainstthecage
To get the all required files, simply download "SuperOneClickv1.5.5-ShortFuse.zip". That's what I used.
Get it here: http://forum.xda-developers.com/showthread.php?t=803682
Extract the contents of the ZIP, open a command-prompt on your computer and change to the directory where the extracted files are located.
Some advice if shell commands are not your regular cup of tea.
The following instructions show the shell commands. Some are executed on the host computer. Others are executed on the Galaxy Tab. You can differentiate between the two easily: All commands which start with "> " need to be executed in a shell on the host computer. Commands which are prefixed with "$ " are executed on the Galaxy Tab. In both case the ">" and the "$" must not be typed. If you copy+paste from this howto, make sure only to copy the commands and leave out the prompt.
==== Step 1: getting a temporary root shell ====
Copy the rageagainstthecage exploit to a temporary directory.
Code:
> adb push rageagainstthecage /data/local/tmp
263 KB/s (5392 bytes in 0.020s)
Change the file permissions and execute the exploit.
Code:
> adb shell
$ cd /data/local/tmp
$ chmod 777 rageagainstthecage
$ ./rageagainstthecage
[*] CVE-2010-EASY Android local root exploit (C) 2010 by 743C
(other output truncated)
Your shell session will be terminated which will throw you back to the regular command prompt of your host computer.
==== Step 2: restart adb server ====
Now stop and restart the adb server process.
Code:
> adb kill-server
> adb start-server
* daemon not running. starting it now *
* daemon started successfully *
Now reconnect to the Galaxy Tab again. Notice the '#' prompt. This means you have a temporary root shell now. We use this to execute some privileged commands which make the rooting permanent.
==== Step 3: making it permanent ====
First, make the system partition writeable. We need this to be able to copy su, busybox and Superuser.apk to the required locations. Then exit the android shell again.
Code:
> adb shell
# mount -o remount,rw -t rfs /dev/block/stl9 /system
# exit
Now we push busybox and su via adb. Then we install Superuser.apk.
Code:
> adb push busybox /system/bin
> adb push su /system/bin
> adb install Superuser.apk
The final steps are to change the file permissions for su and busybox and then remount the system partition as read-only again.
Code:
> adb shell
# chmod 4755 /system/bin/busybox
# chmod 4755 /system/bin/su
# mount -o remount,ro -t rfs /dev/block/stl9 /system
# exit
That should be all. Try a reboot and some apps which require root, like Titanium Backup. The Superuser.apk should popup a dialog requesting permission.
Hope this helps. Happy rooting.
[update]
This process worked for JMA and JMD as well.
"adb install" Superuser.apk instead of "adb push"
[/update]
It will help me !
Merci ;-)
Fantastic! This is just what I was looking for, thank you! I feel dumb now, because I started a thread of my own right as you posted this. You must just type faster than me
I ran a quick test, and it all looks good. One quick question actually. Why do you mount like this:
Code:
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
When most instructions for the Galaxy Tab have you doing something like this:
Code:
# mount -o remount,rw -t rfs /dev/block/stl9 /system
I'm not saying it is wrong, in fact, it actually worked for me. I'm just curious as to why it works like that? My understanding of mounting partitions and such in Linux is a little bit weak, so I like to indulge my curiousity by bugging fine people like yourself
Anyway, thanks again, this did exactly what I needed it to. Well done, I appreciate it.
DavidThompson256 said:
One quick question actually. Why do you mount like this:
Code:
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
When most instructions for the Galaxy Tab have you doing something like this:
Code:
# mount -o remount,rw -t rfs /dev/block/stl9 /system
I'm not saying it is wrong, in fact, it actually worked for me. I'm just curious as to why it works like that? My understanding of mounting partitions and such in Linux is a little bit weak, so I like to indulge my curiousity by bugging fine people like yourself
Click to expand...
Click to collapse
Thanks for pointing that out! Actually both the filesystem type and blockdevice name were totally wrong. Apparently the mount command ignores both parameters - at least when they are wrong.
I just verified this as self-punishment for not paying attention:
Code:
# mount
(...)
/dev/block/stl9 /system rfs ro,relatime,vfat,log_off,check=no,gid/uid/rwx,iocharset=utf8 0 0
(...)
/system is mounted read-only to /dev/block/stl9. This is the normal state of things.
Now I remount this without the fstype parameter and using a wrong blockdevice name:
Code:
# mount -o remount,rw /dev/block/xyz /system
# mount
(...)
/dev/block/stl9 /system rfs rw,relatime,vfat,llw,check=no,gid/uid/rwx,iocharset=utf8 0 0
(...)
Surprise, this actually remounts /system in read-write mode. This is why my original howto worked despite using the wrong parameters.
Thanks again. I corrected the HOWTO.
It works for me, but i get now error message: The application calendar save (proces com.android.providers.calendar) is unexpecly stopt. Try again. Forced closing
I had this also with SuperOneClick.
When i want to start the calender in the applications i get it also.
The application wil not run anymore.
How can i resolved this.
Thnx
leonreijnders said:
It works for me, but i get now error message: The application calendar save (proces com.android.providers.calendar) is unexpecly stopt. Try again. Forced closing
I had this also with SuperOneClick.
When i want to start the calender in the applications i get it also.
The application wil not run anymore.
How can i resolved this.
Thnx
Click to expand...
Click to collapse
That is strange. The result of the rooting process is just adding three files to the system partition. I find it hard to believe that this could lead to the problem you describe. However, while experimenting with z4root I had the the effect that there were many rageagainstthecage processes running in the background and the Galaxy Tab slowed down considerably. Perhaps there is something similar going on.
Have you tried rebooting after completing the rooting process?
Try shutting down the Tab completely.After rebooting get a shell on the Tab with "adb shell" and execute "ps". That shows the process list. If that looks normal, I would try a factory reset of the device. Which ROM version are you running?
BlackLevel: Thank you soooooooooo much... I don't get how to hit the Thanks Meter thing, but here is the old fashioned way. I used a MacBook to accomplish your perfect, step by step rooting of an AT&T Galaxy Tab i987. It helps that I'm more comfortable at the command line than with most GUI systems.
I could put this into a bash script, but that could be dangerous. People really need to look at whats happening with 'adb' and have some idea of what adb is for. I did renamed your 'adbmac' to 'adb', then I could cut and paste from your instructions except for adding ./ before the adb... ie. ./adb shell
Again, wonderful work at pulling this all together in one place.
Jeff
This guide worked perfectly! I love a nice quiet clean root and it doesn't get any better than this. You my friend deserve a cookie!
Hi Guys,
I flashed to JMA, rooted it with One Click Root, and everxthing seemdet to be okay, but activating OCLF failed....is there anybody with the same problem?
Jan
Thanks a lot !. It's clean and doesn't need a kies ...
Just a question : after reboot I have to use "su" after "adb shell" to become root.
Is there any way to be root directly after adb shell ?
And thanks again ...
Mike
mbaroukh said:
Just a question : after reboot I have to use "su" after "adb shell" to become root.
Is there any way to be root directly after adb shell ?
Click to expand...
Click to collapse
The reason is that "/sbin/adbd" (the adb daemon) is running as the shell user. It would need to run as root user instead. This requires changes to the initial ram disk where adbd the relevant settings are stored.
Dealing with "insufficient permissions for device"
Thanks, this worked for me.
One small thing: running from a Linux sustem (Ubuntu 9.04), to overcome a "insufficient permissions for device" problem, I had to put my Ubuntu terminal session into su mode and restart the ADB server -- cf. groups.google.com /group/android-discuss/browse_thread/thread/f85a795644e65b59?pli=1 :
[[
adb kill-server
sudo adb start-server
adb devices
]]
gklyne said:
One small thing: running from a Linux sustem (Ubuntu 9.04), to overcome a "insufficient permissions for device" problem, I had to put my Ubuntu terminal session into su mode and restart the ADB server -- cf. groups.google.com /group/android-discuss/browse_thread/thread/f85a795644e65b59?pli=1 :
[[
adb kill-server
sudo adb start-server
adb devices
]]
Click to expand...
Click to collapse
Thanks for the feedback. On my Ubuntu 10.10 adb runs under my regular user-id (1000) and I do not have to use sudo or run the local adb server as root. That might be due to the way the udev rules are set up. Mine are rather unrestrictive and look like this:
Code:
$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEMS=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
How do yours look like?
Which is the more simple method for root of galaxy tab euro ?are there ?
the incredible said:
Which is the more simple method for root of galaxy tab euro ?are there ?
Click to expand...
Click to collapse
Try z4root or SuperOneClick. Both methods are wrappers of the rageagainstthecage exploit and try to automate the manual process outlined here.
This thread should be a sticky. Worked like a charm.
z4root is very simple method..thanks.
thanks to Germany...
I agree, this thread should be sticky. Finaly some sense in android devel section...
Thank you very much for your guide!
I followed all the instructions in your guide, everything seems fine until I try to push the busybox and su to my Galaxy Tab.
blacklevel said:
Now we push busybox and su via adb. Then we install Superuser.apk.
Code:
> adb push busybox /system/bin
> adb push su /system/bin
> adb install Superuser.apk
[/update]
Click to expand...
Click to collapse
I received an error: "failed to copy 'busybox' to '/system/bin/busybox' : No space left on device\"
the same error for the 'su' too
(No space left on device) is impossible, my tab is brand new sealed when i got it.
I have been trying the z4root and SuperOneClick procedure to root this tab but are all unsuccessful.
I am not sure if it is because of my tab needed a "NAND unlock" (I cannot find any guide about the NAND unlock) because I received this message when I tried to install busybox from the market.
Please help! My tab is carrier locked to Bell Canada, I really wanna to unlock it and root it~
Thanks!
gummo6869 said:
I received an error: "failed to copy 'busybox' to '/system/bin/busybox' : No space left on device\"
the same error for the 'su' too,
Click to expand...
Click to collapse
The `no space left on device` message indicates that the /system partition is still read-only. That means the mount command in step 3 was unsuccessful. Did you get any error message when you executed it?

Cant Run ADB Commands

Im trying to downgrade my Desire Z. Using this code:
Code:
adb push psneuter /data/local/tmp
adb push misc_version /data/local/tmp
adb shell chmod 777 /data/local/tmp/psneuter
adb shell chmod 777 /data/local/tmp/misc_version
adb shell /data/local/tmp/psneuter
adb shell
When i type:
adb push psneuter /data/local/tmp
I get this message:
cannot stat 'psneuter': No such file or directory
I then tried to push the same file if i added .txt at the end of psneuter.
This still did not work.
I then typed cd [directory] and tried it (without .txt) and it still did not work.
I then tried it with .txt and it works.
So i had to cd the directory and then add the file extension? Guessing this isn't normal, but i could deal with it.
However when i got to the third line, i don't know the file extension of misc_version, so i was unable to continue. Can anyone shed some light please? What am i doing wrong or what haven't i done?
Thanks
NthZ said:
Im trying to downgrade my Desire Z. Using this code:
Code:
adb push psneuter /data/local/tmp
adb push misc_version /data/local/tmp
adb shell chmod 777 /data/local/tmp/psneuter
adb shell chmod 777 /data/local/tmp/misc_version
adb shell /data/local/tmp/psneuter
adb shell
When i type:
adb push psneuter /data/local/tmp
I get this message:
cannot stat 'psneuter': No such file or directory
I then tried to push the same file if i added .txt at the end of psneuter.
This still did not work.
I then typed cd [directory] and tried it (without .txt) and it still did not work.
I then tried it with .txt and it works.
So i had to cd the directory and then add the file extension? Guessing this isn't normal, but i could deal with it.
However when i got to the third line, i don't know the file extension of misc_version, so i was unable to continue. Can anyone shed some light please? What am i doing wrong or what haven't i done?
Thanks
Click to expand...
Click to collapse
Sounds like you didn't set your path; either set a path to adb or make sure all the files are in the same directory of adb and run the commands from that directory
Sent from my T-Mobile G2 using XDA App
OriginalGabriel said:
Sounds like you didn't set your path; either set a path to adb or make sure all the files are in the same directory of adb and run the commands from that directory
Sent from my T-Mobile G2 using XDA App
Click to expand...
Click to collapse
i thought i did set a path though. and it doesn't explain why i need to add the file extension...or is that normal?
can you remind me how to set a path please? i went to computer and path>edit then added the directory of platform-tools and tools to the list. is that all thats needed? where should i save the files such as psneuter?
thanks
All I do is rip out the needed adb files and put them in a folder on my dekstop. Then you can push the files you need to your device.
Sent from my SCH-I500 using Tapatalk
NthZ said:
i thought i did set a path though. and it doesn't explain why i need to add the file extension...or is that normal?
can you remind me how to set a path please? i went to computer and path>edit then added the directory of platform-tools and tools to the list. is that all thats needed? where should i save the files such as psneuter?
thanks
Click to expand...
Click to collapse
Sounds like you added the path correctly; if you did, you should be able to run adb from anywhere. It doesn't matter where the files are on your computer, what matters is that you're running the commands from that folder.
For example, if all the files are in C:\root_files then when you open up a command prompt, you need to type 'cd C:\root_files', hit enter and then run the adb commands from there.
Sent from my T-Mobile G2 using XDA App
Can you not drag and drop the files into the terminal in Windows like you can on Mac?
thanks for all the comments. will have another go tomorrow.
i made another thread but no one has answered, my desire z is running android 2.2.1. do i need to downgrade to 2.2, then 1.74, then 1.34 to root it, or can i go straight from 2.2.1 to 1.34?
Thanks
The 2.2.1 is android version, not sense version.
You need to downgrade to 1.34 sense version, which is also running 2.2 I think.
-Nipqer
i solved the above problem but now have a new problem.
After i typed "adb shell /data/local/tmp/psneuter"
to try and get temporary root, i got this message: /data/local/tmp/psneuter: permission denied
I googled about a bit and tried another command:
C:\Root_Files>adb shell
adb server is out of date. killing...
* daemon started successfully *
$ cd /data/local/tmp
cd /data/local/tmp
$ chmod 0755 psneuter
chmod 0755 psneuter
$ ./psneuter
./psneuter
property service neutered.
killing adbd. (should restart in a second or two)
Then tried adb shell again.
It granted me root access, but i figured i'd try and stick to the tutorial i was on.
so i went back and typed adb shell /data/local/tmp/psneuter again, and now i get this message:
mmap() failed. Operation not permitted
however if i typed "adb shell" i get #.

[Q] Linux user with some questions about root methods.

Okay folks, I am a rooting newb where it comes to this wonderous device known as the Optimus G, and I need some questions answered.
First lemme fill you all in on some details where the computer I might be using to root my Optimus G is concerned. I run Zorin OS 6.1 64bit Core edition (yes, Linux) and that obviously that begs my first question, of any of the rooting methods mentioned in the development part of this forum, are there any that will work with Linux? And if so which ones or is there some kind of special magic I'll need to cast or some kind of coding wizardry level I'll have to obtain in order to be able to root my Optimus G?
Second, to fill you in on the phone, yes I have updated to ZV9 so if that borks me if you could please let me know?
Third, and Fourth actually are my concerns over being able to fix whatever possible brick type damage might be done. 3)How stable are the root/unlock methods, meaning there would be no way to reverse them? Of course I mean outside of accepting an OTA update which I already know better than to do on a custom ROM (had a Samsung Epic 4g before this so yeah I know how that goes.)
and 4)Is there an LGNPST (sp?) version for Linux or will I have to figure out a wa to maybe run it on WINE or something along those lines?
I'd ask about ROMS but I know everybody has an opinion of their own and I don't so much mind the stock one, though I might get the debloated version and see what else I can do with that.
Thanks in advance everybody for any help you all can give.
1) You can root through linux, although I don't know about which distros. I did it on ubuntu, using one of the links in the link in my sig.
2) AFAIK, you have to be on zv7/8 to root or unlock. You will have to use LGNPST to go back to one of those, and as far as I've ever heard that is a windows program only.
3) Both the root and unlock methods are reversible through whatever program you use to do it.
4) ???
You forgot profit!!!!
Sent from my LG-LS970 using xda premium
As long as you can attain a root shell and install ADB aka Android SDK, and as long as after that you can run ADB shell and then receive a prompt from your device you should be able to push the necessary files and then run the exploit and install the superuser binary there should be no issues. I actually took the windows root method, and used the commands in my Debian box and it worked very well. The only thing that I would be concerned with is weather not you can get a root shell in your specific version once that is attained, run ADB start-server as root then finish.
Basically I took this root method, and modded the script to fit linux.
(as noted from my post on the last page of that thread)
Preparation
ADB can be found either from the android sdk(tools only) or from the 'stuff' folder, in the archive below (i ran the one from the sdk)
Download this zip file, and extract the 'stuff' folder to a newly created 'root' folder on your Desktop
Open a terminal and cd to ~/Desktop/root
My adb location is coded into my $PATH variable so when I issue adb, it runs ~/android-sdk-linux/platform-tools/adb but you can either set up an alias (to the one included which would be alias adb=~/Desktop/root/stuff/adb if you follow the below extraction procedures or the one from the sdk which could be anywhere)
Before running the root I ran:
Code:
su -
adb start-server
exit
Then to test whether or not I had the correct version of adb, I ran:
Code:
adb shell
You should see your prompt change to that of the phone. if it displays any type of error message, please check your version of adb. to exit this prompt and continue with the root, simply type exit and press enter.
ROOT:
Paste the following into your terminal (which should now be in the ~/Desktop/root directory)
Code:
adb "wait-for-device"
adb push stuff/busybox /data/local/tmp/.
adb push stuff/su /data/local/tmp/.
adb push stuff/Superuser.apk /data/local/tmp/.
adb shell chmod 755 /data/local/tmp/busybox
adb restore stuff/fakebackup.ab
echo 'Select "Restore my data" on your phone!'
adb shell "while ! ln -s /data/local.prop /data/data/com.android.settings/a/file99; do :; done" > /dev/null
echo "Your phone will now reboot twice, DO NOT DISCONNECT USB!"
adb reboot
adb "wait-for-device"
adb shell "/data/local/tmp/busybox mount -o remount,rw /system && /data/local/tmp/busybox mv /data/local/tmp/su /system/xbin/su && /data/local/tmp/busybox mv /data/local/tmp/Superuser.apk /system/app/Superuser.apk && /data/local/tmp/busybox cp /data/local/tmp/busybox /system/xbin/busybox && chown 0.0 /system/xbin/su && chmod 06755 /system/xbin/su && chmod 655 /system/app/Superuser.apk && chmod 755 /system/xbin/busybox && rm /data/local.prop && reboot"
echo "Rooting Complete!"
echo "SuperSU should now be available in your applications drawer!"
Assimilated using the interface that interacts with the advanced internet.

The Android Shell

The Android Shell
A "shell" is a program that listens to keyboard input from a user and performs actions as directed by the user. Android devices come with a simple shell program. This shell program is mostly undocumented. Since many people are curious about it I thought I'd write up some documentation for it.
Currently this documentation is incomplete, sorry!
Common problems
The built-in shell has very limited error handling. When you type a command name incorrectly it will say "permission denied", even though the real problem is that it couldn't find the command:
$ dir
dir: permission denied <---- this is a misleading error message, should say 'dir: not found'
$ ls
... listing of current directory
The PATH variable
The Android shell will run any program it finds in its PATH. The PATH is a colon (':') seperated list of directories. You can find out what your shell's PATH is set to by using the built-in echo command:
$ echo $PATH
/data/local/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
Depending upon your shell, you may see a different result.
Built in Commands
Every shell has a few built-in commands. Some common built-in commands are:
echo -- prints text to stdout.
set -- sets shell variables
export -- makes shell variables available to command-line programs
cd -- change the current directory.
pwd -- print name of the current directory.
Commands
To find out what commands you have available to you, use the "ls" command on each of the directories in the PATH variable.
Finding documentation for the Android commands.
Many of the Android commands are based on standard Linux (or bsd) commands. If you're curious about a command, you can sometimes learn how it works by using the "man" command on a desktop Linux or OSX (Apple Macintosh) computer. The Linux or OSX version of the command may be different in details, but much of the documentation will still apply to the Android version of the command.
Another source of documentation for people without a Linux or OSX machine handy is to use a web browser and use a web search engine to search for the text: "man Linux command-name".
List of commands
The following is a list of the commands that are present on a Nexus S phone running an Android 2.3.3 "user-debug" build. Many of these commands are not present on a "user" phone. (They are missing from a "user" phone because they are specific to developing or debugging the Android operating system.)
$ ls /data/local/bin
/data/local/bin: No such file or directory
Notice that by default there is no /data/local/bin directory. You can create this directory using the "mkdir" command if you like.
$ ls /sbin
opendir failed, Permission denied
The /sbin directory exists, but you don't have permission to access it. You need root access. If you have a developer phone, or otherwise have root access to your phone you can see what's in this directory.
$ su
# ls /sbin
ueventd
adbd
# exit
$
Notice that the shell prompt changes from a '$' to a '#' to indicate that you have root access.
Notice also that neither of the /sbin commands are useful to the shell -- the adb and ueventd files are 'daemon' programs used to implement the Android Debugger "adb" program that is used by developers.
$ ls /vendor/bin
gpsd
pvrsrvinit
Vendor/bin is where device vendors can put device-specific executables. These files are from a Nexus S.
$ ls /system/sbin
/system/sbin: No such file or directory
This directory does not exist on a Nexus S.
$ ls /system/bin
am
am is the Android Activity Manager. It's used to start and stop Android activities (e.g. applications) from the command line. Type am by itself to get a list of options.
amix
aplay
Command line audio file player.
app_process
applypatch
Used to apply patches to android files.
arec
Command line audio recorder.
audioloop
bluetoothd
BlueTooth daemon
bmgr
Backup manager - type command by itself to get documentation.
bootanimation
Draws the boot animation. You may have to reset your phone to get out of this.
brcm_patchram_plus
bugreport
cat
Copy the contents of a file to standard output.
chmod
Change the mode of a file (e.g. whether it can be read or written.)
chown
Change the owner of a file.
cmp
Compare two files byte-by-byte
dalvikvm
The dalvik virtual machine. (Used to run Android applications.)
date
Prints the current date and time
dbus-daemon
dd
Convert and copy a file. By default copies standard in to standard out.
debuggerd
dexopt
df
Shows how much space is free on different file systems on your device.
dhcpcd
dmesg
dnsmasq
dumpstate
dumpsys
dvz
fsck_msdos
gdbserver
getevent
getprop
gzip
hciattach
hd
id
ifconfig
Shows the current configuration of network interfaces (IP, MAC address etc)
iftop
Shows the current processes using the network interfaces (top, but for networks)
ime
input
insmod
installd
ioctl
ionice
iptables
Manage the firewall
keystore
keystore_cli
kill
Send signals to processes.
linker
ln
Used to set up a file system link.
log
logcat
Prints the Android runtime log.
logwrapper
ls
Lists files.
lsmod
lsof
make_ext4fs
mediaserver
mkdir
Make a directory.
monkey
A program that sends random events, used to test applications. (Like having a monkey playing with the device.)
mount
mtpd
mv
Move a file from one directory to another. (Only on the same file system. Use "cat a > b" to copy a file between file systems.
nandread
ndc
netcfg
netd
netstat
newfs_msdos
notify
omx_tests
pand
ping
pm
pppd
printenv
ps
List active processes.
qemu-props
qemud
racoon
radiooptions
reboot
Reboot the device.
record
renice
rild
rm
Remove a file.
rmdir
Remove a directory.
rmmod
route
rtp_test
run-as
schedtest
schedtop
sdcard
sdptool
sendevent
service
servicemanager
setconsole
setprop
setup_fs
sh
showlease
sleep
smd
stagefright
start
Starts the Android runtime.
stop
Stops the Android runtime.
surfaceflinger
svc
sync
system_server
tc
testid3
toolbox
top
Shows which processes are currently using the most CPU time.
umount
uptime
Prints how long your device has been running since it was last booted.
vdc
vmstat
vold
watchprops
wipe
wpa_cli
wpa_supplicant
$ ls /system/xbin
add-property-tag
btool
check-lost+found
dexdump
dhdutil
hcidump
latencytop
librank
opcontrol
oprofiled
procmem
procrank
rawbu
scp
Secure copy program. (Used to copy files over the network.)
showmap
showslab
sqlite3
Used to administer SQLite databases.
strace
System trace command - use to see what system calls a program makes.
su
Start a shell with root privileges.
Versions of the Android Shell
Android 1.0 used a shell that had no tab completion or history editing.
Android 2.3 added history editing. You can for example use the up/down arrows to edit previous commands.

Categories

Resources