[Q] Cant access Android shell - General Questions and Answers

I attempted to set the Android ash shell as default based on a thread here by:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
This did not work? Now when i attempt to open shell I see an error:
-exec '/system/bin/sh failed : No such file or directory'
I'm afraid I have screwed up. I thought about writing a small app to execute a shell command to rename the file back to "sh". Would this work? Do I have simpler options?
Any help appreciated
Thanks,
Bill F

Update
Ok, I was able to get the renamed sh file off the phone with adb pull. I renamed it to "sh" and tried to push it back using:
adb push c:\temp\sh /system/bin
but I get an error that says
failed to copy c:\temp\sh to /system/bin/sh : No such file or directory
What should I do?
Thanks,
Bill F

I, too, had a similar problem.

And were you able to fix it?
Bill F

Any answer?
I'm having the same problem. Does anyone have a solution?
bfarley59 said:
Ok, I was able to get the renamed sh file off the phone with adb pull. I renamed it to "sh" and tried to push it back using:
adb push c:\temp\sh /system/bin
but I get an error that says
failed to copy c:\temp\sh to /system/bin/sh : No such file or directory
What should I do?
Thanks,
Bill F
Click to expand...
Click to collapse

Related

help rooting CDMA Hero on windows 7 64 bit

I have been following the unlock instructions on these posts on how to unlock the Hero, but I am having some trouble. When to comes to making the adb shell, it just doesn't do it. It shows a dollar sign and says that the request is denied. I just don't get what I'm doing wrong. Are there extra steps for me because there are x86 files? If I have to put the android sdk into the program files x86 folder, how would I enter that into the commander? Any help would be appreciated guys, this is driving me crazy.
OK so you get to the dollar sign. What do you do then?
Kamar234 said:
I have been following the unlock instructions on these posts on how to unlock the Hero, but I am having some trouble. When to comes to making the adb shell, it just doesn't do it. It shows a dollar sign and says that the request is denied. I just don't get what I'm doing wrong. Are there extra steps for me because there are x86 files? If I have to put the android sdk into the program files x86 folder, how would I enter that into the commander? Any help would be appreciated guys, this is driving me crazy.
Click to expand...
Click to collapse
Just extract the sdk so its a folder. Then go to Start->Run-> type cmd.exe in the box that opens. Now navigate to where you extracted the sdk folder. If you extracted it straight onto the c:\ drive at top level, you'd do something like this:
Code:
cd c:\android-sdk\tools
That will get you into the directory that has adb.exe
Now follow the instructions in the "how to root" thread.
I can get down to the point where I execute the adp push and all the lines come up saying that the adp is restarted and there is obviously a command that is executed.
adb shell
chmod 0755 /data/local/asroot2
this part is when it says access is denied. I follow everything perfectly, but I just don't get it.
Oh, easy.
Type "su" and hit enter.
The dollar sign prompt indicates you are running as a regular user. Run su and it will give you a # prompt indicating you are running as root.
Then do the chmod.
It specifically says after entering this line
/data/local/asroot2 /system/bin/sh
system cannot find the path specified. Any ideas?
so when the dollar sign comes up, just type su and hit enter, that's it?
Kamar234 said:
It specifically says after entering this line
/data/local/asroot2 /system/bin/sh
system cannot find the path specified. Any ideas?
Click to expand...
Click to collapse
Are you sure the asroot2 file has been copied over to your phone? What I did is extract asroot2 into the tools folder, so that I could just say adb push asroot2 /data/local/
My suggestion is to make sure the file is in /data/local/
Also, here is the full thing taken from the other thread:
Code:
adb push /directory_you_placed_asroot2/asroot2 /data/local/
adb shell
chmod 0755 /data/local/asroot2
/data/local/asroot2 /system/bin/sh
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4755 su
Yup, I put it in the tool folder within the android sdk. I am using the 1.5 sdk as well.
I just really can't understand what I'm doing wrong
Do:
ls -al /data/local
Do you see asroot there?
it says not found. I entered it by the dollar sign
Kamar234 said:
it says not found. I entered it by the dollar sign
Click to expand...
Click to collapse
That means the file isn't copied over. You need to do the adb push line again, and make sure it copies the file over.
how do I do that? Is there a something that it does or says to let you know it has copied over?
Kamar234 said:
how do I do that? Is there a something that it does or says to let you know it has copied over?
Click to expand...
Click to collapse
The first line here:
Code:
adb push /directory_you_placed_asroot2/asroot2 /data/local/
That puts the asroot2 file into your phone's /data/local/ directory.
This line gets you into your phone's shell:
Code:
adb shell
AT THIS POINT, you should see a $ dollar sign. This means you are in your phone.
This line will let you check that asroot2 has been copied over:
Code:
ls -al /data/local
This line gives the file you just copied over, permission to execute/run:
Code:
chmod 0755 /data/local/asroot2
This line runs the file you copied over:
Code:
/data/local/asroot2 /system/bin/sh
This line mounts your file system on your phone as writable:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
I am also running windows 7 through vmware fusion, do you think that would make a difference.
Kamar234 said:
I am also running windows 7 through vmware fusion, do you think that would make a difference.
Click to expand...
Click to collapse
I don't know, I don't think it should. Can you type everything in and then paste us your results?
Type pwd and hit enter.
What do you see?
Thank you so much for all your help everyone. I think I may have finally gotten it. If I am installing an app that needs root access, will it install at all if the phone isn't rooted?

[Resolved] [Q] adb install results in "/sbin/sh: pm: not found"

I am using a rooted HTC G2 with Clockwork recovery and Cyanogenmod 6.1.1.
I broke my launcher, ADW EX, using Ninjamorph; the phone now gets stuck on the boot animation.
My planned solution was to use adb install to restore a backup of ADW EX.
Using adb pull I pulled a backup of ADW EX and placed in C:\
I mounted /system and /data in recovery
Using adb from recovery I entered adb shell and removed the broken ADW EX with:
rm /data/app/org.adwfreak.launcher-2.apk
Next, I exited adb shell and entered:
adb install C:\org.adwfreak.launcher-2.apk
This generated the error:
/sbin/sh: pm: not found
I cannot get past this error and successfully install the application. I am learning as I go, any direction or assistance is welcome. I miss my Android
Solved
In case any other doofus' run into this situation.
As I have now learned, the "adb install" command will not work from recovery.
Because I had broken my launcher, and I had no alternative launchers installed, there was no launcher to hand-off to after booting; the result was an endless boot animation. Calls and notifications could still be received, etc. Most importantly, the phone was no longer in recovery and "adb install" could be used.
adb install C:\org.adwfreak.launcher-2.apk
Press "home"
Fixed.
hi,
in adb shell type:
cd /system/bin
cp pm ap_process /sbin/
exit
and now try again to install/uninstall the app.
hosseinb said:
hi,
in adb shell type:
cd /system/bin
cp pm ap_process /sbin/
exit
and now try again to install/uninstall the app.
Click to expand...
Click to collapse
I am getting error at second command
/system/bin >> cp pm ap_process /sbin/
cp pm ap_process /sbin/
cp: can't stat 'pm': No such file or directory
cp: can't stat 'ap_process': No such file or directory
can you tell why
nialexme said:
I am getting error at second command
/system/bin >> cp pm ap_process /sbin/
cp pm ap_process /sbin/
cp: can't stat 'pm': No such file or directory
cp: can't stat 'ap_process': No such file or directory
can you tell why
Click to expand...
Click to collapse
Sorry for my delay;
It's because the files (pm & ap_process) do not exist in /system/bin , try to locate them by "find" command:
adb shell
#find / -name ap_process
good luck
~ # find / -name ap_process
find: /sys/kernel/slab/L2TP/IP: No such file or directory
~ # exit
and now ?!!
kb667 said:
~ # find / -name ap_process
find: /sys/kernel/slab/L2TP/IP: No such file or directory
~ # exit
and now ?!!
Click to expand...
Click to collapse
Do you have root access? Have you installed busybox?

Root fail

Okay, so I tried doing the One-Click Exploit and nothing happened (yes, I had the USB Debugging checked, allow for external developers, and USB Charge Only). So then I tried the manual root. My phone rebooted, but it wasn't rooted. Now when I try to do the Manual Root it says (after the ./zerg) :
[-] Cannot copy boomsh.: Permission denied
[1] + Stopped <signal> ./zerg
And when I tried doing the One-Click again, it rebooted my A2 a couple times and still didn't get it rooted. Help???
Ok first remove the tmp directory in the same place you copied zerg to.
Here are the commands:
From windows:
Launch a command line - go to start run and type cmd or command
Then from the prompt cd to the directory you installed the SDK in and do the following commands:
adb shell
cd /data/local (This will need to be the directory you copied the zerg file to the first time.)
rm ./tmp/*
rm ./tmp/*.*
rm ./tmp
Then follow this post from the root thead:
http://forum.xda-developers.com/showpost.php?p=19916762&postcount=194
Right now there is not a one click for the latest root methods.
The other thing I would do is read through the how to root thread, because there are people that have been able to root by using both the one click and the manual method at the same time to get it to root.
Link to the root thread:
http://forum.xda-developers.com/showthread.php?t=1327741&page=20
Alright, thank you...but I'm a bit rusty with my MS-DOS and I didn't get very far to begin with. So what do you mean by "cd to the directory" and how would I do that? Unfortunately I'm not very sure which directory I installed the SDK in. I think it's data/local/. Here's some of the lines:
c:\Users\User\Deskstop\Exploit\adb shell
shell(character I don't recognize)edison:/$ cd /data/local
cd /data/local
shell(" "):/data/local$ chmod 777 zerg
Sorry for being a little on the illiterate side...I'm like the shadetree mechanic of computers.
According to the xda news,superoneclick has added the zerg rush exploit to it's program.might could try it.
Sent from my MB865
Sent from my MB865
JDtech1701 said:
I'm like the shadetree mechanic of computers.
Click to expand...
Click to collapse
Hey shadetree mechanics keep cars running
Sent from my MB865 using xda premium
JDtech1701 said:
Alright, thank you...but I'm a bit rusty with my MS-DOS and I didn't get very far to begin with. So what do you mean by "cd to the directory" and how would I do that? Unfortunately I'm not very sure which directory I installed the SDK in. I think it's data/local/. Here's some of the lines:
c:\Users\User\Deskstop\Exploit\adb shell
shell(character I don't recognize)edison:/$ cd /data/local
cd /data/local
shell(" "):/data/local$ chmod 777 zerg
Sorry for being a little on the illiterate side...I'm like the shadetree mechanic of computers.
Click to expand...
Click to collapse
You will just highlight each line of commands ONE AT A TIME, then past it to your DOS terminal window then hit return, but just one line at a time.
Ok after you connect to your phone with ADB shell you should see:
see a $ for your prompt.
then copy these lines and paste them one at a time and hit return in your DOS terminal window:
su
cd /data/local
rm ./tmp/*
rm ./tmp/*.*
rm ./tmp
Then follow this:
http://forum.xda-developers.com/showpost.php?p=19916762&postcount=194
http://forum.xda-developers.com/showthread.php?t=1327741
Alright, I put in:
c:\Users\User\Deskstop\Exploit\adb push zerg /data/local
c:\Users\User\Deskstop\Exploit\adb push su /data/local
c:\Users\User\Deskstop\Exploit\adb push superuser.apk data/local
c:\Users\User\Deskstop\Exploit\adb shell
And then I put in all the commands you gave and..."rm failed"
lilhaiti said:
Hey shadetree mechanics keep cars running
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
I know, I was a shadetree auto mechanic myself for a couple years (now I'm a heavy equipment diesel technician...intern). I'm just trying to say that I'm not literate enough to be a developer or anything, but at the same time I know more than your average user.
JDtech1701 said:
Alright, I put in:
c:\Users\User\Deskstop\Exploit\adb push zerg /data/local
c:\Users\User\Deskstop\Exploit\adb push su /data/local
c:\Users\User\Deskstop\Exploit\adb push superuser.apk data/local
c:\Users\User\Deskstop\Exploit\adb shell
And then I put in all the commands you gave and..."rm failed"
Click to expand...
Click to collapse
can you paste the output for me, so I can point you to the next step, or give me the exact error that rm showed? If I can get than I can help you move forward.
It looks like you were having an issue with a previous attemp at root, and there are some temp files we will need to find and remove first before you can try to root again.
Sure!
C:\Users\User\Desktop\Exploit>adb shell
shell(character I don't recognize)edison:/$ su
su
su: not found
shell(" ")edison:/$ cd /data/local
cd /data/local
shell(" ")edison:/data/local$ rm ./tmp/*
rm ./tmp/*
shell(" ")edison:/data/local$ rm ./tmp/*.*
rm ./tmp/*.*
rm failed for ./tmp/*.* No such file or directory
shell(" ")edison:/data/local$ rm ./tmp
rm ./tmp
rm failed for ./tmp, Is a director
shell(" ")edison:/data/local$
JDtech1701 said:
Sure!
C:\Users\User\Desktop\Exploit>adb shell
shell(character I don't recognize)edison:/$ su
su
su: not found
shell(" ")edison:/$ cd /data/local
cd /data/local
shell(" ")edison:/data/local$ rm ./tmp/*
rm ./tmp/*
shell(" ")edison:/data/local$ rm ./tmp/*.*
rm ./tmp/*.*
rm failed for ./tmp/*.* No such file or directory
shell(" ")edison:/data/local$ rm ./tmp
rm ./tmp
rm failed for ./tmp, Is a director
shell(" ")edison:/data/local$
Click to expand...
Click to collapse
Ok, good lets try this to remove the tmp directory.
adb shell
cd /data/local
rm -r ./tmp/
If that does not work install the root explorer app from the adroid market
https://market.android.com/details?id=com.speedsoftware.rootexplorer&hl=en
and locate the /data/local directory and then delete the tmp directory there. This will be the easiest way to remove that stubborn old tmp directory and those files that are holding you up from getting root. Once you have that done try the oneclick again, from here:
http://forum.xda-developers.com/showthread.php?t=1327741
In my experience, deleting the sh and boomsh files is sufficient to enable zergrush to run again. I didn't have to delete the tmp directory itself.
This would've been done in the step you already ran
Code:
shell(" ")edison:/data/local$ rm ./tmp/*
jimbridgman said:
and locate the /data/local directory and then delete the tmp directory there. This will be the easiest way to remove that stubborn old tmp directory and those files that are holding you up from getting root. Once you have that done try the oneclick again, from here:
http://forum.xda-developers.com/showthread.php?t=1327741
Click to expand...
Click to collapse
OK download the moto drivers. 32x or 64x.
Then get the zip file from the root link I'm this forum it should be a batch file your run. It opens a cmd window and follow the steps.
Profit.
It was super easy phone reboots and your rooted on the stock firmware. Pm me of you need the files for some reason I have them.saved in my mass android folder.
Best of luck.
Sent from my Rooted MB865 using XDA App
jimbridgman said:
Ok, good lets try this to remove the tmp directory.
adb shell
cd /data/local
rm -r ./tmp/
If that does not work install the root explorer app from the adroid market
https://market.android.com/details?id=com.speedsoftware.rootexplorer&hl=en
and locate the /data/local directory and then delete the tmp directory there. This will be the easiest way to remove that stubborn old tmp directory and those files that are holding you up from getting root. Once you have that done try the oneclick again, from here:
http://forum.xda-developers.com/showthread.php?t=1327741
Click to expand...
Click to collapse
Uh...are you sure I should remove the tmp directory? It looks like it's got some important stuff in there. Wait...is "tmp" short for temporary?
JDtech1701 said:
Uh...are you sure I should remove the tmp directory? It looks like it's got some important stuff in there. Wait...is "tmp" short for temporary?
Click to expand...
Click to collapse
Yes, but this is not the OS temporary directory, just the one that is, I am guessing in /data/local, or where you copied those files to... I am guessing since you don't have root yet that, that is not /, because then ./tmp would be /tmp (the OS temporary directory, we don't want to remove that one)..... but I am guessing that is not the case since you don't have root.
Yeah I am pretty sure it is safe... I work with UNIX and Linux for a living, and Android happens to be a form of Linux.
Like others have posted, you might be able to try the root process again, since the files that zerg was complaining about are now gone, from the rm ./tmp/* command you ran before... I was just trying to be very thorough.
Okay, I got that Root Explorer and went into tmp and did select all and delete. Now there's .. Parent folder, .X11-unix, appicon, and commdrv left. I tried doing the adb push zerg all the way down to ./zerg as listed in the How To you linked...and it gave me the exact same result. And when I opened Root Explorer, I went straight to tmp. I tried going to the data folder but it said my phone needed to be rooted first. Okay, figuring this app out...yeah, I went to /tmp. I'm not going to be able to access /data/local without rooting it first.
both the 1-click and the manual process fails for me too. I have tried deleting all the files and directory as well and it still doesn't work. When I run either ./zerg or ./zergRush it both fails with the message "Hellion with Blue Flame". Any help would be appreciated.
bbygfy said:
both the 1-click and the manual process fails for me too. I have tried deleting all the files and directory as well and it still doesn't work. When I run either ./zerg or ./zergRush it both fails with the message "Hellion with Blue Flame". Any help would be appreciated.
Click to expand...
Click to collapse
Which system version are you running.... You can find this out by going into settings --> About phone; then give me the text under System version. It should be something like 55.11.16.MB865.ATT.en.US.
Jim
55.11.16.MB865.ATT.en.US
Thanks!

[Q] /system/bin/sh: tcpdump: No such file or directory

I have generated a **tcpdump** file to run on an Android device using [this guide][not able to post the link here]. Instead of `Fedora`, I made this file on `Ubuntu 12.04` .
Everything worked smoothly and **tcpdump** file was produced correctly. I copied `tcpdump` file at `/system/bin/` on Nexus-5 and ran following commands.
> adb shell
# ln -s /system/bin/tcpdump /system/xbin/tcpdump
# chmod 06755 /system/xbin/tcpdump
# reboot
After restarting computer, when I run `> adb shell tcpdump -h` , I get following error:
/system/bin/sh: tcpdump: No such file or directory
Can someone help me figure out the problem? Thanks!

[Q] Question about RO /system/bin

Hello XDA need your support.I am trying to fix a bootloop but I cannot run the ADB SHELL - exec '/system/bin/sh' failed: No such file or directory (2) - when I try to insert the sh file with adb push it sends me Cannot Copy "Read-Only" system
I know I can unlock the /system with the shell codes but my urgent question is how I can insert this sh file because android cant find it
And the most important is then the ADB SHELL is needed for fastboot commands
Any Ideas ?

Categories

Resources