[Q] ADB shell opens in superuser prompt # - Android Software/Hacking General [Developers Only]

I am trying to update a few things on my G2 and when I go in to adb shell, the prompt opens at the superuser level (the # prompt). Typing exit exits adb shell, it does not take me to the $ prompt. Any thoughts on how I can get to the $ prompt? It has worked fine in the past.
Thanks
Edit: disregard. It appears that I still have the regular adb shell and SU levels, but both have the # prompt. Still curious if anybody knows what causes that, but it seems to be working as it should.

Some custom roms open to a root shell... if you have a stock rom then idk what's going on
Sent from my Droid using Tapatalk

I actually first noticed it when on CM 6.1, but it was still showing the # prompt when I restored to my rooted stock. But, there still is the difference between $ and #, I just need to make sure I keep track of which one I am really using at the moment.

if you use 2nd-init or custom boot image you will get default #

Related

"ADB Shell" gives me "#" instead of "$" when rooting MyTouch Slide, why??

"ADB Shell" gives me "#" instead of "$" when rooting MyTouch Slide, why??
trying to root my MyTouch 3G Slide. Ive tried various methods from different sites to do it but they all seem to come down to running something called "ADB Shell". On the screenshots, it seems to always give you a $ prompt. When I do it, I get a # prompt. Also, anything I type after that is just repeated back to me along with another # prompt. I find where other people get the same problem but cant find any solutions with it. What am I doing wrong?
kellyjaye said:
trying to root my MyTouch 3G Slide. Ive tried various methods from different sites to do it but they all seem to come down to running something called "ADB Shell". On the screenshots, it seems to always give you a $ prompt. When I do it, I get a # prompt. Also, anything I type after that is just repeated back to me along with another # prompt. I find where other people get the same problem but cant find any solutions with it. What am I doing wrong?
Click to expand...
Click to collapse
In Linux and Unix systems (Android Included) a # (Pound Symbol) signifies Root level access or su (Superuser) so since you're rooting your device this means you have done it, $ appears for any other user of the system
i have the same problem too. I'm using window xp and it giving me the # symbol instead of $. any suggestion to fix it? i have checked all the drivers, slideroot files are in androidsdk file
like Captainkrtek said, if you're getting a # for your adb shell, you ARE rooted.
root shell should look something like this:
Code:
$ adb shell
#

Changing icons ERROR

Hello. I have rooted my phone, with superuser mode. or w.e you guys call it.
I was trying to change the Android icons(Rogers HTC MAGIC Android 2.1) using this guide: http://forum.xda-developers.com/showthread.php?t=927405
BUT, when I type adb shell, then su a # pops up on cmd. When I type the other commands nothing happens. EG when I type cp /sdcard/HtcContacts.apk /system/app/HtcContacts.apk it displays cp unknown. What's going on? I have also given it superuser privileges. Help? ^^;

Noob guide: how to start terminal emulator as root.

The way to start the terminal as root is pretty easy.
Open term emulator and then hit the menu button and go into preferences. You need to go down to the bottom where it says something like initial command. Click that and at the end of the export command you see (I think the end is after $PATH) type ;su then hit enter. Now whenever you start TE you get su immediately.
Sent by breaking the sound barrier
Indirect said:
The way to start the terminal as root is pretty easy.
Open term emulator and then hit the menu button and go into preferences. You need to go down to the bottom where it says something like initial command. Click that and at the end of the export command you see (I think the end is after $PATH) type ;su then hit enter. Now whenever you start TE you get su immediately.
...
Click to expand...
Click to collapse
Sorry to re-open this old thread, but can anyone suggest modification to the terminal emulator that may allow it to START as root. Typing "su" afterwards switches the user, however the app DOESN'T start initially as root.
There's a better way to do it. Allow me to elaborate some logic:
In Terminal Emulator, whatever you set as the 'shell command line', basically is nothing more than the command you set as the 'initial shell command'. The key difference is that the 'shell command line' is initiated prior to the 'initial shell command'. Therefore, anything set as 'initial shell command' to automate root access comes secondary to the shell you have already started (through the 'shell command line'), which will cause you opening a shell in a shell and thus having to exit two shells. This is dirty. You could work around that with an 'initial shell command' like "su && exit", but it'll remain to be a dirty solution.
If you want the shell in Terminal Emulator to start as root, then set the following 'shell command line' (personally I prefer bash):
Code:
[SIZE="3"]/system/xbin/su -c "/system/xbin/bash -"[/SIZE]
That way only, Terminal Emulator will actually start your session as root and nothing more but root. When you exit the shell, you exit the one and only shell initiated as root ending your session at once.
Now for the 'initial shell command', which you no longer require to obtain root using the above method, I personally have the following set to keep things consistent and give the shell a nice looking start:
Code:
[SIZE="2"]mkdir -p /data/local/bin && export PATH=/data/local/bin:$PATH && clear && uname -a && echo[/SIZE]
I hope this clarified things a bit.
Albert
bitmaster2000 said:
There's a better way to do it. Allow me to elaborate some logic:
In Terminal Emulator, whatever you set as the 'shell command line', basically is nothing more than the command you set as the 'initial shell command'. The key difference is that the 'shell command line' is initiated prior to the 'initial shell command'. Therefore, anything set as 'initial shell command' to automate root access comes secondary to the shell you have already started (through the 'shell command line'), which will cause you opening a shell in a shell and thus having to exit two shells. This is dirty. You could work around that with an 'initial shell command' like "su && exit", but it'll remain to be a dirty solution.
If you want the shell in Terminal Emulator to start as root, then set the following 'shell command line' (personally I prefer bash):
Code:
[SIZE="3"]/system/xbin/su -c "/system/xbin/bash -"[/SIZE]
That way only, Terminal Emulator will actually start your session as root and nothing more but root. When you exit the shell, you exit the one and only shell initiated as root ending your session at once.
Now for the 'initial shell command', which you no longer require to obtain root using the above method, I personally have the following set to keep things consistent and give the shell a nice looking start (think twice before commenting about the mkdir if you don't like it):
Code:
[SIZE="2"]mkdir -p /data/local/bin && export PATH=/data/local/bin:$PATH && clear && uname -a && echo[/SIZE]
I hope this clarified things a bit.
Albert
Click to expand...
Click to collapse
Thanks a lot, I solved the problem somewhat differently, in a way that may cause some raised eyebrows from people concerned with security. I created a copy of "sh", did a chmod 6755 on it, and set it as the shell. The reason for this is that I don't have superuser installed on my phone.
Off topic, it's all moot now because I managed to drop it again and the LCD detached from the gorilla glass. Happens once every 9 months. I came to XDA to see from my old posts where I bought the screen before.
Initial Command not working in cm11 (s7262).
Entering su in Initial Command in Terminal Emulator Preferences get this result:
Code:
[email protected]:/ $ 8;53R
Entering manually su command get OK., but initial command is not working.
How can I fix this problem?
Thanks.

[Q] Need help after rooting followed by reset, BADLY!!!!!!!

Okay, So I have a Samsung Admire running 2.3.4 and has a kernel of 2.6.35.7. Purchased 3 weeks ago. I rooted the phone and within a day I had lost the ability to make or receive calls. the phone app crashes every time.and I thought that I had deleted some vital file and thus ruined the phone. After a couple days and nights reading and experimenting I believe that that changing the screen density with Rom Toolbox from 160 to 167 is causing the app to fail. Now the problem is my inability to get rooted again, after resetting back to factory. Nothing I have tried will work and what may, seems baffling. I tried multiply times the original method that was successful, Admire_Root_Windows, Super one click, I tried running both from the SD card, I even downloaded a handful of Android Development programs because I read somewhere that I had to, I'm desperate here. I even came across this :
This was successful with: (I bought the phone 3 days ago)
Android: 2.3.4
Kernel: 2.6.35.7
You need a copy of su, and superuser. (If you have superone click, its all there, just run it adb from that directory)
adb shell "rm /data/log/dumpState_app_native.log 2>/dev/null"
adb shell "ln -s /data/local.prop /data/log/dumpState_app_native.log 2>/dev/null"
adb shell "app_process /dev/null"
REM This command may take a while.
adb shell "echo "ro.kernel.qemu=1" > /data/local.prop 2>/dev/null"
adb reboot
REM Device vibrates (kinda pulses) This is good.
adb wait-for-device
adb shell "rm /data/local.prop 2>/dev/null"
adb shell "rm /data/log/dumpState_app_native.log 2>/dev/null"
adb remount
Thats it, your device is rooted. Now to install the goodies...
adb push su /system/xbin/su
adb shell "chmod 4755 /system/xbin/su"
adb shell "ln -s /system/xbin/su /system/bin/su"
adb install Superuser.apk
Now, before anything else happens, I was having issues with full root. (Root checker claimed everything was fine.. titanium backup worked, but could not remove some crapware..) so at this point, you can go into /system/app and remove the Metro apks. I'd recommend clearing Dalvik cache after you're done as well.
adb reboot
That looks great but there are no instructions and in where does that get typed?
I will have to go buy another at some point tomorrow if I dont get this phone fixed. All I need to do is change the screen res back to 160 and I "think" it will be fine. Everything else runs like a champ. BTW, I do have a LG Optimus T / LG P509 running 2.2. maybe I can use it to fix the other. It's inactive and I have no plans to call tmobile and have it turned on. Please make your answers as though you are dealing with someone who's had a lobotomy, seriously.
How can I reroot?
Thanks,
Zeke
Well...Never mind, I managed to get it figured out...
Thanks,
Zeke

HTC One X Root Assistance

Hey guys. I just got my HOX and have been trying to root it. The software update keeps popping up and I keep refusing, so no worries there. I've got 1.85 right now and have been attempting the methods found here and here, but they just aren't working. I'd prefer to use the manual method. Someone willing to help a guy get started with all this would be the greatest person ever, just saying!
blinkbomber said:
Hey guys. I just got my HOX and have been trying to root it. The software update keeps popping up and I keep refusing, so no worries there. I've got 1.85 right now and have been attempting the methods found here and here, but they just aren't working. I'd prefer to use the manual method. Someone willing to help a guy get started with all this would be the greatest person ever, just saying!
Click to expand...
Click to collapse
check pm
beaups said:
check pm
Click to expand...
Click to collapse
Could you help me too X( ? I got my HOX last night at 8pm; I traded my rooted S2 Skyrocket for it.
Been looking for the past day through forums and google. It's so different from Samsung's phones, but a nice change indeed.
I'm on 1.85 and tried those two methods also. I'm not very familiar with ADB. From reading all night and this morning, I believe I root, unlock bootloader, flash recovery, flash custom roms?
smartnphone said:
Could you help me too X( ? I got my HOX last night at 8pm; I traded my rooted S2 Skyrocket for it.
Been looking for the past day through forums and google. It's so different from Samsung's phones, but a nice change indeed.
I'm on 1.85 and tried those two methods also. I'm not very familiar with ADB. From reading all night and this morning, I believe I root, unlock bootloader, flash recovery, flash custom roms?
Click to expand...
Click to collapse
Follow the instructions in this link http://forum.xda-developers.com/showthread.php?p=30741993
Sent from my HTC One X using xda premium
abhipati said:
Follow the instructions in this link http://forum.xda-developers.com/showthread.php?p=30741993
Sent from my HTC One X using xda premium
Click to expand...
Click to collapse
Thanks. I used this for ADB http://www.addictivetips.com/mobile/what-is-adb-and-how-to-install-it-android/
I remember using it for my S2, but I don't quite understand the directions for the http://forum.xda-developers.com/showthread.php?t=1709296 method. Could you dumb it down for this HOX noob?
smartnphone said:
Thanks. I used this for ADB http://www.addictivetips.com/mobile/what-is-adb-and-how-to-install-it-android/
I remember using it for my S2, but I don't quite understand the directions for the http://forum.xda-developers.com/showthread.php?t=1709296 method. Could you dumb it down for this HOX noob?
Click to expand...
Click to collapse
I'll try to help! all of the following is my interpretation of the rooting method described here: http://forum.xda-developers.com/showthread.php?t=1709296
What you need:
HOX on ATT 1.85
su binary from http://dl.dropbox.com/u/don'tusemeimabadsubinary
EDIT: The su binary above has issues. Use this one instead: http://dl.dropbox.com/u/9060692/su
Make sure HTC sync is NOT RUNNING (down in system tray)
Make sure phone is set to "charge only" and usb debugging is enabled!
Download correct su file (assuming you don't have a problem with this step )
Put su in same directory as ADB. Get to adb command prompt and cd into that directory
Quote from Butters619: cd means change directory. It is a windows command prompt command. So you would type "cd C:\adb" if that was where your adb folder was. Folder and directory can be used interchangeably, although directory is more "correct". We only say folder because GUIs use folders to represent directories.
NEW - pull sim card
NEW - do factory reset
NEW - when reset is complete, do not replace sim, do NOT connect to wifi. Go through setup, go to settings, enable USB debugging. When that's done:
Enter these commands in adb:
adb shell rm /data/data/com.redbend.vdmc/lib/libvd*
adb shell ln -s /data/local.prop /data/data/com.redbend.vdmc/lib/libvdmscomo.so
(If you get file doesn't exist after the FIRST command don't worry - they may not be there)
Now, on the phone, go to settings and check for software update. It will tell you you need to connect to network. Now, replace the SIM OR connect to wifi. Have it check for software update again. When it's done, do NOT click "yes" or "ok" on the phone. Simply:
Enter these commands in adb:
adb shell ls -l /data/local.prop
IF AND ONLY IF you get "file not exists" or anything like that then set your phone's date 2 days ahead and reboot the phone and start over. If you get file info, you're golden. Proceed...
Enter these commands into adb:
adb shell "echo 'ro.kernel.qemu=1' > /data/local.prop"
Reboot via adb by entering this command: adb reboot
After phones reboots
Enter these commands in adb:
adb remount
adb push su /system/xbin/su
adb shell chown 0.0 /system/xbin/su
adb shell chmod 06755 /system/xbin/su
adb shell rm /data/local.prop
adb reboot
You should be rooted.
A cool username said:
I'll try to help! all of the following is my interpretation of the rooting method described here: http://forum.xda-developers.com/showthread.php?t=1709296
What you need:
HOX on ATT 1.85
su binary from http://dl.dropbox.com/u/don'tusemeimabadsubinary
EDIT: The su binary above has issues. Use this one instead: http://dl.dropbox.com/u/9060692/su
Make sure HTC sync is NOT RUNNING (down in system tray)
Make sure phone is set to "charge only" and usb debugging is enabled!
Download correct su file (assuming you don't have a problem with this step )
Put su in same directory as ADB. Get to adb command prompt and cd into that directory
Quote from Butters619: cd means change directory. It is a windows command prompt command. So you would type "cd C:\adb" if that was where your adb folder was. Folder and directory can be used interchangeably, although directory is more "correct". We only say folder because GUIs use folders to represent directories.
NEW - pull sim card
NEW - do factory reset
NEW - when reset is complete, do not replace sim, do NOT connect to wifi. Go through setup, go to settings, enable USB debugging. When that's done:
Enter these commands in adb:
adb shell rm /data/data/com.redbend.vdmc/lib/libvd*
adb shell ln -s /data/local.prop /data/data/com.redbend.vdmc/lib/libvdmscomo.so
(If you get file doesn't exist after the FIRST command don't worry - they may not be there)
Now, on the phone, go to settings and check for software update. It will tell you you need to connect to network. Now, replace the SIM OR connect to wifi. Have it check for software update again. When it's done, do NOT click "yes" or "ok" on the phone. Simply:
Enter these commands in adb:
adb shell ls -l /data/local.prop
IF AND ONLY IF you get "file not exists" or anything like that then set your phone's date 2 days ahead and reboot the phone and start over. If you get file info, you're golden. Proceed...
Enter these commands into adb:
adb shell "echo 'ro.kernel.qemu=1' > /data/local.prop"
Reboot via adb by entering this command: adb reboot
After phones reboots
Enter these commands in adb:
adb remount
adb push su /system/xbin/su
adb shell chown 0.0 /system/xbin/su
adb shell chmod 06755 /system/xbin/su
adb shell rm /data/local.prop
adb reboot
You should be rooted.
Click to expand...
Click to collapse
Thanks. Yeah i've been trying it alld ay but it can't find where my SU is. it's in the same location as the ADB stuff i believe C:\android-sdk-windows. Seem like some of the senior members are willing to go through teamviewer to help the ones who can't do it. I'll try asking them :/
Sorry I couldn't be of any help, but please let me know if/how you get this to work just in case this happens to me when I get my one x.
Sent from my Touch Pro 2 using xda app-developers app
---------- Post added at 08:22 PM ---------- Previous post was at 08:18 PM ----------
blinkbomber said:
Hey guys. I just got my HOX and have been trying to root it. The software update keeps popping up and I keep refusing, so no worries there. I've got 1.85 right now and have been attempting the methods found here and here, but they just aren't working. I'd prefer to use the manual method. Someone willing to help a guy get started with all this would be the greatest person ever, just saying!
Click to expand...
Click to collapse
I wonder if the one who actually started this thread got his/her phone to work...???
Sent from my Touch Pro 2 using xda app-developers app
Someone think they can help me root the phone? I'm on 1.85 and I believe I finally got adb to recognize my device but after that I don't think I'm doing it right
Sent from my SGH-I777 using XDA Premium App

Categories

Resources