Use adb from within android terminal - G Tablet Q&A, Help & Troubleshooting

Hello.
I'm trying to install adb on my tablet so that I might issue adb/fastboot commands to my Android phone.I downloaded this file which is a zip of the platform-tools directory. I put it on my internal memory' but I also tried it from /data/. The problem is that when I enter that directory and enter "adb" I get a permission denied error. OK, so I enter a root shell and try again, only to get a not found error. "./adb" also returns a permission error even from a root shell.
Anyone have any ideas?

You are trying to run an Intel binary on an ARM processor.

Related

Help "pushing" files to eris using mac

So ive been trying to figure out how to push files onto my eris for like a week now and im not smart enough with computer to so it. Ive downloaded the mac ADB, and have a 2.2 emulator up and running. But when i plug my phone in i cant ever find it using terminal. Im pretty sure its just cause im using the wrong commands so if anyone knows them for a mac that would be awesome. Any info would help me, Thanks.
No emulator is involved. Find the adb executable, and cmd+c to copy it. Fire up terminal and cmd+v to paste it, then type a space, then "push" (without the quotes), then a space, then drag the file you want to copy onto the terminal window, then type the location on your phone you plan on pushing to (like /system/app/ for example). And that's it! But you should do an adb remount before pushing. Again, to do a remount, paste the adb file into terminal or drag it in, then type a space, then "remount" (without the quotes).
It's been a while since I did the initial install steps, but the main difference to the commands is having to use a dot and a slash before the command "./" to specify the command you want to run is in the directory you're working in. Other than that, the PC steps are the same.
For example, my files are in a sub-directory under my user profile: /Users/<user_name>/Phone/android-sdk-mac_86/tools/ which can also be typed as ~/<user_name>/Phone/android-sdk-mac_86/tools/
So, in Finder, I go to that directory and double click the android file. That starts terminal which also starts the Android app. I go back to Terminal, press Command+T to open a new tab in Terminal (just so I won't have a ton of windows open), change directory to ~/<user_name>/Phone/android-sdk-mac_86/tools/ then I run the adb command typed as ./adb
So, to re-cap step by step:
My adb files are located in ~/<user_name>/Phone/android-sdk-mac_86/tools/
Make sure your phone is connected in USB debugging mode
In Finder, go to the above directory and double click android
Switch back to Terminal, press Command+T to open a new tab and change directory to ~/<user_name>/Phone/android-sdk-mac_86/tools/
Type: ./adb remount
Type ./adb shell (or whatever adb commands you want to run)

[Q] Linux distro binaries within Android?

I just extracted the Gentoo Stage3 package for ARM7A and I am playing around trying to get the binaries to run either through terminal emulator or adb shell on my Galaxy Tab running Gingerbread.
I am FULLY aware of how PATH works and all of the normal reasons you would get a "not found" error when trying to run a command, but this one has me stumped.
I tried setting my path to include a subdirectory of /system/bin as follows:
PATH=/system/bin/gentoo:$PATH and gentoo is where I put my gentoo binaries.
When I do which (command) it says:
/system/bin/gentoo/(command)
When I try to run it, it runs the same command from one of the other directories such as /system/xbin (from busybox) instead.
I tried renaming one of the binaries so it has a unique name mv ps wtf I can still do which wtf and get /system/bin/gentoo/wtf
THEN when I try to run it I get wtf: not found.
Obviously the file is there. Even if I go directly to /system/bin/gentoo and do ./wtf I get wtf: not found. If I copy one of the Android system binaries to /system/bin/gentoo/wtf it will run just fine.
Why would I get a not found error for a binary that is obviously there??
I would expect a different error if it wasn't an acceptable binary, so I am lost.
Any ideas?
rustyshack3 said:
I just extracted the Gentoo Stage3 package for ARM7A and I am playing around trying to get the binaries to run either through terminal emulator or adb shell on my Galaxy Tab running Gingerbread.
I am FULLY aware of how PATH works and all of the normal reasons you would get a "not found" error when trying to run a command, but this one has me stumped.
I tried setting my path to include a subdirectory of /system/bin as follows:
PATH=/system/bin/gentoo:$PATH and gentoo is where I put my gentoo binaries.
When I do which (command) it says:
/system/bin/gentoo/(command)
When I try to run it, it runs the same command from one of the other directories such as /system/xbin (from busybox) instead.
I tried renaming one of the binaries so it has a unique name mv ps wtf I can still do which wtf and get /system/bin/gentoo/wtf
THEN when I try to run it I get wtf: not found.
Obviously the file is there. Even if I go directly to /system/bin/gentoo and do ./wtf I get wtf: not found. If I copy one of the Android system binaries to /system/bin/gentoo/wtf it will run just fine.
Why would I get a not found error for a binary that is obviously there??
I would expect a different error if it wasn't an acceptable binary, so I am lost.
Any ideas?
Click to expand...
Click to collapse
Just a guess, but I'd bet that the linker path for the binary is having trouble finding a library.

[Q] adb push HELP

Lil' Help... New stock SGS2 phone arrived today... I successfully flashed Entropy512's "stock kernel + rooted stock system image" via Odin3 (v1.85). Worked perfect, phone rebooted, now I have root. 2nd step, I extracted the zImage from Codeworkx's CWM tar file (put zImage in same PC desktop folder as my adb.exe files). I want to use adb push to push zImage file to phone so I can avoid the triangle/counter of death. Anyway, I got this error in my CMD window:
C:\Android\android-sdk-windows\platform-tools>adb push zImage /sdcard/zImage
error: device not found
What went wrong? The "phone" and "card" are recognized by windows explorer, but when trying to use adb commands, get "error: device not found"
Thx.
DoctorQMM said:
Lil' Help... New stock SGS2 phone arrived today... I successfully flashed Entropy512's "stock kernel + rooted stock system image" via Odin3 (v1.85). Worked perfect, phone rebooted, now I have root. 2nd step, I extracted the zImage from Codeworkx's CWM tar file (put zImage in same PC desktop folder as my adb.exe files). I want to use adb push to push zImage file to phone so I can avoid the triangle/counter of death. Anyway, I got this error in my CMD window:
C:\Android\android-sdk-windows\platform-tools>adb push zImage /sdcard/zImage
error: device not found
What went wrong? The "phone" and "card" are recognized by windows explorer, but when trying to use adb commands, get "error: device not found"
Thx.
Click to expand...
Click to collapse
Try to start by verifying that adb can see your phone.
type "adb devices" (no quotes)
This should return a number, if not, the phone is not being seen by adb.
If not check drivers, cable, try different usb port.
If it does return a number you are properly connected.
Proceed to:
adb push zImage /sdcard/zImage
adb shell dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
Might need to as su if prompt shows $ instead of #
Try adb remount
i didnt realize so many people cared about a little triangle that you see for about 3 seconds on boot.
DoctorQMM said:
Lil' Help... New stock SGS2 phone arrived today... I successfully flashed Entropy512's "stock kernel + rooted stock system image" via Odin3 (v1.85). Worked perfect, phone rebooted, now I have root. 2nd step, I extracted the zImage from Codeworkx's CWM tar file (put zImage in same PC desktop folder as my adb.exe files). I want to use adb push to push zImage file to phone so I can avoid the triangle/counter of death. Anyway, I got this error in my CMD window:
C:\Android\android-sdk-windows\platform-tools>adb push zImage /sdcard/zImage
error: device not found
What went wrong? The "phone" and "card" are recognized by windows explorer, but when trying to use adb commands, get "error: device not found"
Thx.
Click to expand...
Click to collapse
You're missing drivers or haven't enabled USB debugging. Drivers for USB Mass Storage are built into Windows, drivers for ADB are not. Not sure what the procedure is for installing Windows ADB drivers... It's one of the reasons I almost never use Windows for working with my phone.
I've heard Droid Explorer might come with a drivers package, not sure.
Entropy512 said:
You're missing drivers or haven't enabled USB debugging. Drivers for USB Mass Storage are built into Windows, drivers for ADB are not. Not sure what the procedure is for installing Windows ADB drivers... It's one of the reasons I almost never use Windows for working with my phone.
I've heard Droid Explorer might come with a drivers package, not sure.
Click to expand...
Click to collapse
PDANET is free and simple to install on any Windows based machine. Less than 30 seconds and it recognises every phone I have tried so far. You just need to be sure to get the right one for you OS, 64 or 32 bit.
I sent to my kids that are too lazy to install the Android SDK.....
SNadler said:
Try to start by verifying that adb can see your phone.
type "adb devices" (no quotes)
This should return a number, if not, the phone is not being seen by adb.
If not check drivers, cable, try different usb port.
If it does return a number you are properly connected.
Proceed to:
adb push zImage /sdcard/zImage
adb shell dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
Might need to as su if prompt shows $ instead of #
Click to expand...
Click to collapse
I appreciate everyone's input... OK, here's where I stand:
adb does now recognize phone. After typing "adb devices", cmd window showed my phone in list of devices attached. I then proceeded to "adb push zImage /sdard/zImage... that seemed to work also [cmd window came back with "2544 KB/s (6718048 bytes in 2.578s)]. Next, I typed "adb shell dd if=/sdcard/zImage of=/dev/block/mmcblk0p5" [cmd window came back with "/dev/block/mmcblk0p5: cannot open for write: Permission denied"]
so is still a drivers issue? cable issue? or something else? Thx again
EDIT: one additional clue for all the experts: the zImage is now on my /sdcard. When I type "adb shell", I do get "$" instead of "#" in cmd window... and I know I have root on phone. When I type "adb shell su" in cmd window, I get "Permission denied".
Sometimes the root install won't completely work until you go to the Superuser app once manually. (e.g. in Applications).
Also, another possibility may be that there are two ways to run adb shell:
One is
Code:
adb shell <command>
Where it'll run <command> and then exit
Then there is
Code:
adb shell
<command1>
<command2>
exit
In the second, when you first type "adb shell" you'll get a shell prompt on your phone.
Then you'll type su (this will give you superuser privileges)
Then you run the dd command
Then you should be good.
The difference is: If you have a custom "insecure" kernel, an ADB shell defaults to root privileges. If you have a stock kernel, ADB shell defaults to "mortal user", and you need to manually use su to get root privileges.
Pushing the file to the SD card does not require root, writing the kernel to the kernel partition (mmcblk0p5) does.
Entropy512 said:
Sometimes the root install won't completely work until you go to the Superuser app once manually. (e.g. in Applications).
Also, another possibility may be that there are two ways to run adb shell:
One is
Code:
adb shell <command>
Where it'll run <command> and then exit
Then there is
Code:
adb shell
<command1>
<command2>
exit
In the second, when you first type "adb shell" you'll get a shell prompt on your phone.
Then you'll type su (this will give you superuser privileges)
Then you run the dd command
Then you should be good.
The difference is: If you have a custom "insecure" kernel, an ADB shell defaults to root privileges. If you have a stock kernel, ADB shell defaults to "mortal user", and you need to manually use su to get root privileges.
Pushing the file to the SD card does not require root, writing the kernel to the kernel partition (mmcblk0p5) does.
Click to expand...
Click to collapse
===============
Entropy512... you da man! I'm good to go now. As you recommended, even though I've been using Root Explorer and I know I was 'rooted', had to open SuperUser app on phone... then in the cmd window when I typed "adb shell" I got the "$" prompt. So at the $ prompt I typed "su"... this gave me the "#" prompt. SuperUser App then asked for SU permission acceptance. Then did the "dd xxxxxxxx" command, and it came back with:
13121 +1 records in
13121 +1 records out
6718048 bytes transferred in 2.895 secs (2320569 bytes/sec).
Rebooted phone to recovery, and have the light blue CWM Recovery 5.0.2.3.
Now I'm rooted, have CWM, and no triangle/counter of death. Hope this helps anyone else with a similar situation.
Again, a BIG shoutout to Entropy512, SNadler, jivy26, et al., for your constructive and quick replies. This forum is the best!
DocQ
One last [Q] Do I have to leave the large "zImage" file (6.41mb) in the /sdcard folder, or can it be removed /moved now that CWM successfully flashed?
DoctorQMM said:
One last [Q] Do I have to leave the large "zImage" file (6.41mb) in the /sdcard folder, or can it be removed /moved now that CWM successfully flashed?
Click to expand...
Click to collapse
No need to leave it, although I keep a bunch of various kernels in /sdcard/kernels myself - it's up to you.

[Q] Proper adb command

Sorry for the noob question, but I am having some troubles doing a backup with adb. I have my phone rooted and can connect with adb, however I cant do a "adb pull / d:\whereveriwantit" without it just saying skipping special file for everything. I'm assuming because it is not pulling as root. So I try "adb shell" then "su" and I get root privileges, but then I cant figure out how to copy everything to say /sdcard/temp/ for me to then copy to my laptop (my unix command knowledge is lacking). Any help would be appreciated.
[EDIT] After some more playing around. I guess I can pull some things using the adb pull / <dir> , but alot of files are skipped "skipping special file" or "permission denied". Would using the proper commands in the shell after switching to root user be a better way to get the files copied?

[Q] Unrbricking- how to force Windows to use specific driver?

Hi, I'm trying to unbrick some GoClever tablet. The only "working" thing is fastboot. Windows can see the device but it says:
"Windows has stopped this device because it has reported problems." and I can't install fastboot driver for this device.
When I try to manually update the driver choosen from disk it says that it's not compatible (but my driver is for sure for that device).
I can also run recovery but can't access to shell (no such file /system/bin/sh) and when I pull sh from original ROM it says "permission denied". And I think there is no way to change permissions without access to shell, but I can't access to shell because it doesn't have permission to execute
Any way to unrbick this device?

Categories

Resources