adb shell help - Android Q&A, Help & Troubleshooting

Hi everyone, i need a little help.
While in adb i was about to do some modding and i entered adb shell, so as soon as i het enter i also started typing su.
well now when i enter adb shell i dont just get the # sign.
mine looks like this ~ #
no commands can be found now.
How do i get back to the default directory?
Thanks

hackit said:
Hi everyone, i need a little help.
While in adb i was about to do some modding and i entered adb shell, so as soon as i het enter i also started typing su.
well now when i enter adb shell i dont just get the # sign.
mine looks like this ~ #
no commands can be found now.
How do i get back to the default directory?
Thanks
Click to expand...
Click to collapse
Type 'cd /' without the quotes.
Did the default.prop file get changed?

Related

hello to a new forum, and already a newb question...

OK. Firstly, I have extensive experience with rooting moto droids and custom roms. That said I got cocky and didn't do enough homework trying to root my girls Eris and proceeded following the instructions in the "1.5 to rooted 2.1" thread. Step 1 went fine. I THINK I have root access. Anyway, like I was tired and couldn't get adb shell working so I left it at that with intent to finish today when I get home from work. Now she's telling me her icons are different and some are linking to different programs. Any ideas? Second, can someone point me in the direction of an adb shell how to, on my Droid I can just use terminal emulation and don't actually need a computer so I'm not too familiar with the process... sorry for the stupid newborn questions, don't pull the flame throwers out yet, thanks!
You can use terminal emulator, same thing for the most part as adb... I use that more then adb, faster then having to connect to a pc IMO.
I tried the terminal emulator and got adb not found or not allowed or some craziness like that. Does that mean I didn't root like I thought? Also, any clue about the icon s changing or linking to other apps like shes claiming? I'm going to try again when she gets home
In the terminal emulator you would not need to type adb.. adb is the program you would be using on a pc to talk to the phone... what is it that you are trying to type through adb or the terminal?
III: Flashing a Custom Recovery
Flashing a custom recovery will make your life easier when flashing ROMs in the future.
1. Download this file: Recovery.zip
2. Extract file contents to your \tools\ directory of your Android SDK.
3. Open up a command prompt and go to your tools directory, and execute these commands:
adb shell mount -o rw,remount /dev/block/mtdblock3 /system
adb push recovery.img /sdcard
adb push flash_image /system/bin
adb shell chmod 755 /system/bin/flash_image
adb shell flash_image recovery /sdcard/recovery.img
4. Success! You now have a recovery partition installed on your phone. You can access it by running "adb shell reboot recovery" or by powering off your phone, holding "Volume Up + Power On"
step 3. im an ass. ok so dont type the adb. like i said, not much exp in this part... im guessing i dont tye shell either, but i do type mount?
evilsway said:
III: Flashing a Custom Recovery
Flashing a custom recovery will make your life easier when flashing ROMs in the future.
1. Download this file: Recovery.zip
2. Extract file contents to your \tools\ directory of your Android SDK.
3. Open up a command prompt and go to your tools directory, and execute these commands:
adb shell mount -o rw,remount /dev/block/mtdblock3 /system
adb push recovery.img /sdcard
adb push flash_image /system/bin
adb shell chmod 755 /system/bin/flash_image
adb shell flash_image recovery /sdcard/recovery.img
4. Success! You now have a recovery partition installed on your phone. You can access it by running "adb shell reboot recovery" or by powering off your phone, holding "Volume Up + Power On"
step 3. im an ass. ok so dont type the adb. like i said, not much exp in this part...
Click to expand...
Click to collapse
Oh I see, for that yes you will need to get the SDK setup on your PC as per step 2... There is another thread that has a batch file that does all of this for you. You still need the SDK though.
see: http://forum.xda-developers.com/showthread.php?t=651669
ok, i have the sdk, i followed these instructions to the letter, and i still couldnt get it running last night, where in the sdk do i do this from or is it a command promp, or can i use the terminal emulator?
yes in the command prompt, typically adb.exe will be in your tools folder.
also, and i know im being a pain now, but by adb does it mean the adb in the tools directory of the sdk, i click it and it runs a script then dissapears.
evilsway said:
also, and i know im being a pain now, but by adb does it mean the adb in the tools directory of the sdk, i click it and it runs a script then dissapears.
Click to expand...
Click to collapse
yes, adb needs to be ran through the command prompt, if you click on it in windows it wont work... read the thread I linked you to, you wont need to run adb if you use that method, it does it all for you.
yeah im downloading the file now, but im just curious, now i want to be able to do it just to do it. i hate when i cant figure crap like this out,
so far ive done this, opened command promp, put in C:\androidsdk\android-sdk-windows\tools\adb.exe and it runs a script then nothing
evilsway said:
yeah im downloading the file now, but im just curious, now i want to be able to do it just to do it. i hate when i cant figure crap like this out,
so far ive done this, opened command promp, put in C:\androidsdk\android-sdk-windows\tools\adb.exe and it runs a script then nothing
Click to expand...
Click to collapse
go to start, run and type cmd and enter. then in that window
you have to change to the tools directory at the command prompt like so"
cd androidsdk\android-sdk-windows\tools
then type adb
Renocat said:
go to start, run and type cmd and enter. then in that window
you have to change to the tools directory at the command prompt like so"
cd androidsdk\android-sdk-windows\tools
then type adb
Click to expand...
Click to collapse
Yeah, once you do what he states and type...
cd androidsdk\android-sdk-windows\tools ... or where ever you have your SDK saved at on your computer ... you should be good to start running those scripts in the directions.

[Q] Restore backup, MD5 problems!

Backuped the Infusion 2.0 rom in cwm recovery 4.0.0.8 and i cannot restore it in cwm 4.0.0.2 in cf-root. The MD5 sum does not match!:
Can i do anything to fix this, it`s quite annoying.
I solved my problem bit i`d like to know for future events.
-SOLVED-
I'm really really sorry to tell you but when the MD5 does not match, you're stuck.
prodygee said:
I'm really really sorry to tell you but when the MD5 does not match, you're stuck.
Click to expand...
Click to collapse
thank you for jour answer, does this have anything to do with different recovery versions?
gee2012 said:
thank you for jour answer, does this have anything to do with different recovery versions?
Click to expand...
Click to collapse
Guess it`s just a bad flash
Try restoring the parts manually using an "advanced restore". that should work.
use this
http://forum.xda-developers.com/showthread.php?t=1356401&highlight=md5
and this tutorial on how to use ADB
Check if your phone is detected by ADB
Open up Command Prompt (Go to run, type in cmd, press enter)
Type in:
cd C:\**your sdk name**\tools (Press Enter)
adb devices (Enter) You should see your device listed
adb shell (Enter) you should see $ in the next line
**After you obtain root**
su (Enter) you should see # in the next line if you are already rooted
**you may need to allow adb shell to run as root. Look at the phone and see if Superuser.apk is asking for your permission to allow adb root access. Click on "Remeber my selection" and select yes.
Now you are all set to run adb commands as root or as a regular user
# cd /sdcard/clockworkmod/backup/2010-06-29.20.22.53
# rm nandroid.md5
# md5sum *img > nandroid.md5
**Note: for a list of commands that you can type using adb type "adb" in cmd

[Q] ADB Troubles

Hello, I am using a Droid Razr Maxx CDMA (XT912). I have Android version 4.2.2. I am using Cyanogen mod 10.1.
I am having problems opening ADB. When I turn my USB Debugging on under my dev. options, connect my device in PTP mode using the terminal emulator commands:
su
setprop persist.sys.usb.config mass_storage
reboot
I run the ADB program and a window comes up for a brief moment then closes. I am unable to open ADB. I have Java.
Thank You!
ADB Troubles Cont'd.
nathanielhall929 said:
Hello, I am using a Droid Razr Maxx CDMA (XT912). I have Android version 4.2.2. I am using Cyanogen mod 10.1.
I am having problems opening ADB. When I turn my USB Debugging on under my dev. options, connect my device in PTP mode using the terminal emulator commands:
su
setprop persist.sys.usb.config mass_storage
reboot
I run the ADB program and a window comes up for a brief moment then closes. I am unable to open ADB. I have Java.
Thank You!
Click to expand...
Click to collapse
Did adb kill-server and adb start-server several times in cmd with no avail. The device serial number shows up under adb devices, but ADB Program will still not open. I've tried to open ADB up in cmd also.
I also tried typing in the terminal emulator:
su
setprop persist.sys.usb.config mass_storage, adb
reboot
Thanks again!
Can someone please help me with this?
I even tried installing the Universal naked drivers and that wouldn't go through.
nathanielhall929 said:
I even tried installing the Universal naked drivers and that wouldn't go through.
Click to expand...
Click to collapse
I copied your command and pasted here. setprop persist.sys.usb.config mass_storage, adb
And what I find is posted here. setprop persist.sys.usb.config mass_storage,adb
And reboot afterwards.
Notice the extra space in your command before adb?
I found this command structure several locations and only one that reports failed has the space.
For ICS it also shows adb shell as in
adb shell setprop persist.sys.usb.config mass_storage,adb
adb reboot
I hope this helps.
Tried it without the space and still not working
tobdaryl said:
I copied your command and pasted here. setprop persist.sys.usb.config mass_storage, adb
And what I find is posted here. setprop persist.sys.usb.config mass_storage,adb
And reboot afterwards.
Notice the extra space in your command before adb?
I found this command structure several locations and only one that reports failed has the space.
For ICS it also shows adb shell as in
adb shell setprop persist.sys.usb.config mass_storage,adb
adb reboot
I hope this helps.
Click to expand...
Click to collapse
I just tried it without the space, rebooted, and nothing
I don't get it
nathanielhall929 said:
I just tried it without the space, rebooted, and nothing
Click to expand...
Click to collapse
The ADB Program just won't open up on this computer. It opens for a second spewing command info then closes. Is it my Java program?
nathanielhall929 said:
I just tried it without the space, rebooted, and nothing
Click to expand...
Click to collapse
Are you getting an error?
This is the other method I see being used but I'll break the command as I believe it should be.
adb shell
su
setprop persist.sys.usb.config mtp,adb
exit
adb reboot
My problem is I know nothing about your unit and I don't know whether it should be mtp or mass_storage. I see people failing with mass_storage are being told to use mtp.
in terminal it shows
su
setprop persist.sys.usb.config mass_storage,adb
reboot
or
su
setprop persist.sys.usb.config mtp,adb
reboot
To retrieve this info I used the top search that says Search All Forums and typed in your command then hit search. You may need to do the same and only go to the threads that suit your situation.
---------- Post added at 12:38 AM ---------- Previous post was at 12:26 AM ----------
nathanielhall929 said:
The ADB Program just won't open up on this computer. It opens for a second spewing command info then closes. Is it my Java program?
Click to expand...
Click to collapse
Are you opening cmd and going to the directory with adb and issue your commands or are you trying to click on adb and use it that way?
I'm trying to run it in cmd
I've been trying to fix this for two days now. I'll be back tomorrow.
Figured out
Ok, now I feel like I'm a real noob. I just realized that I was thinking too hard about all of this. Adb doesn't open up in a new window as a regular program would. I thought it did. Oops. Maybe I should have been more thourough in my research. I should have realized that I already opened adb by using the cmd prompt.
This is why my device was recognized under adb devices.
Maybe not...
I still can't figure out how to get this:
http://tricktactoe.com/howto/how-to-record-android-screen-without-screencast/attachment/path-adb/
window to come up.
This is what I'm tring to do
nathanielhall929 said:
I still can't figure out how to get this:
http://tricktactoe.com/howto/how-to-record-android-screen-without-screencast/attachment/path-adb/
window to come up.
Click to expand...
Click to collapse
This is what I am trying to do:
http://tricktactoe.com/howto/how-to-record-android-screen-without-screencast/
Figured out finally!!!
nathanielhall929 said:
This is what I am trying to do:
http://tricktactoe.com/howto/how-to-record-android-screen-without-screencast/
Click to expand...
Click to collapse
I finally figured this out!!!
I want to thank tobdaryl for his time.
Thank you for your time tobdaryl
nathanielhall929 said:
I finally figured this out!!!
I want to thank tobdaryl for his time.
Thank you for your time tobdaryl
Click to expand...
Click to collapse
You are welcome.
Can you help me?
Can you check out this thread.. Maybe you can help me.
http://forum.xda-developers.com/showthread.php?t=2260208

[Q] ADB Shell And Super SU Issue

Okay... So Here Is Whats Up... The Digitizer On My Lg Optimus L9 Is Broken, Cant Touch The Screen Or Anything... But I Would Still Like To Use My Phone, I Can Can View My Screen But Thats All I Can Do,I Wish To Use The Keyboard And Mouse To Control My Screen,I Know This Is Possible Apperantly The Only Way To Do This Is To Access The ADB Shell, Okay,But What The Problem? Well When I Attempt To Gain Access To The ADB Shell... Super SU Gets In The Way, I Cant Grant Access To The ADB Shell Because I Cant Touch The Screen Do To The Broken Digitizer, And I Cant Click It When It Appears On The Display Because I Dont Have Super SU Permision To Use The Controlls Do To Being Denied Access Of The ADB Shell, If You Under Stand My Cicumstances Please Assist Me In Any Way, The Only Stipulation, No Factory Reset! Please And Thank You!
savagemessiah97 said:
Okay... So Here Is Whats Up... The Digitizer On My Lg Optimus L9 Is Broken, Cant Touch The Screen Or Anything... But I Would Still Like To Use My Phone, I Can Can View My Screen But Thats All I Can Do,I Wish To Use The Keyboard And Mouse To Control My Screen,I Know This Is Possible Apperantly The Only Way To Do This Is To Access The ADB Shell, Okay,But What The Problem? Well When I Attempt To Gain Access To The ADB Shell... Super SU Gets In The Way, I Cant Grant Access To The ADB Shell Because I Cant Touch The Screen Do To The Broken Digitizer, And I Cant Click It When It Appears On The Display Because I Dont Have Super SU Permision To Use The Controlls Do To Being Denied Access Of The ADB Shell, If You Under Stand My Cicumstances Please Assist Me In Any Way, The Only Stipulation, No Factory Reset! Please And Thank You!
Click to expand...
Click to collapse
You should still be able to access adb shell at the shell level, what is likely happening is that you are dropping into a root shell and this is causing SuperSU to prompt if you want to allow adb shell to have root access. What are the exact steps you are taking when you go to use adb shell?
shimp208 said:
You should still be able to access adb shell at the shell level, what is likely happening is that you are dropping into a root shell and this is causing SuperSU to prompt if you want to allow adb shell to have root access. What are the exact steps you are taking when you go to use adb shell?
Click to expand...
Click to collapse
I Use Android Screencast Plus Android SDK, Then I Use Command Prompt
.Adb Shell
.Su
At That Point Super Su Is Prompted
savagemessiah97 said:
I Use Android Screencast Plus Android SDK, Then I Use Command Prompt
.Adb Shell
.Su
At That Point Super Su Is Prompted
Click to expand...
Click to collapse
I would recommend try starting adb shell (adb shell command) and not dropping into a root shell then skip the su command. So just do
Code:
adb shell
To start adb shell, and then skip the su command.
shimp208 said:
I would recommend try starting adb shell (adb shell command) and not dropping into a root shell then skip the su command. So just do
Code:
adb shell
To start adb shell, and then skip the su command.
Click to expand...
Click to collapse
If I Skip su The cmd Says Not Permited
Code:
•adb shell
•su
•chmod 777 /data/dalvik-cache
•cd /data/dalvik-cache
•chmod 777 ./
This Is My Attempt, Is There An Alternative
savagemessiah97 said:
If I Skip su The cmd Says Not Permited
Code:
•adb shell
•su
•chmod 777 /data/dalvik-cache
•cd /data/dalvik-cache
•chmod 777 ./
This Is My Attempt, Is There An Alternative
Click to expand...
Click to collapse
Trying using adb shell from the command line, instead of Android Screencast. Also what are you trying to do with the device extract your personnel information?
Any progress with this? I'm in the same situation

question about adb shell vs terminal on device.

hi,
quick question..
i put "setprop service.adb.tcp.port 5555" in file.txt, and save this to /sdcard.
if i run "sh /sdcard/file.txt" from adb shell, on pc, then it works and getprop confirms.
if i run "sh /sdcard/file.txt" from terminal emulator, on phone, it says "could not set property".
can someone explain this behaviour? tahnk you.
in addition, where should you save shell scripts on your phone?
do you guys use shell scripts? can you give examples of what you use them for?
MrPresident said:
hi,
quick question..
i put "setprop service.adb.tcp.port 5555" in file.txt, and save this to /sdcard.
if i run "sh /sdcard/file.txt" from adb shell, on pc, then it works and getprop confirms.
if i run "sh /sdcard/file.txt" from terminal emulator, on phone, it says "could not set property".
can someone explain this behaviour? tahnk you.
in addition, where should you save shell scripts on your phone?
do you guys use shell scripts? can you give examples of what you use them for?
Click to expand...
Click to collapse
Try "su" command first and grant root access to terminal app
minimale_ldz said:
Try "su" command first and grant root access to terminal app
Click to expand...
Click to collapse
thanks for the reply, minimale.
okay. so, as you suggested, it works when i do it as root from the terminal app.
but couple of things.
1) Why can i run it from adbshell without 'su' command. through adb shell it still works as "[email protected]:/ $" instead of "[email protected]:/ #"
2) how come, without 'su', I can access "/sdcard" (as "[email protected]: / $"). but, as root, I have to go through "/data/media/0"
MrPresident said:
thanks for the reply, minimale.
okay. so, as you suggested, it works when i do it as root from the terminal app.
but couple of things.
1) Why can i run it from adbshell without 'su' command. through adb shell it still works as "[email protected]:/ $" instead of "[email protected]:/ #"
2) how come, without 'su', I can access "/sdcard" (as "[email protected]: / $"). but, as root, I have to go through "/data/media/0"
Click to expand...
Click to collapse
I'm glad I helped, but have no idea where the differences between ADB and terminal emulator come from. It's beyond my current knowledge.
minimale_ldz said:
I'm glad I helped, but have no idea where the differences between ADB and terminal emulator come from. It's beyond my current knowledge.
Click to expand...
Click to collapse
no worries. i got what i need.

Categories

Resources