[Q]ADB issue - Vibrant Q&A, Help & Troubleshooting

Okay, so I'm a bit an ADB noob here. I've been trying to push my avatar apk into /system/apps for awhile here but every time i do so, it fails with this error:
/bin/sh: adb: not found
did I set it up wrong somehow?

Oniyuri said:
Okay, so I'm a bit an ADB noob here. I've been trying to push my avatar apk into /system/apps for awhile here but every time i do so, it fails with this error:
/bin/sh: adb: not found
did I set it up wrong somehow?
Click to expand...
Click to collapse
Make sure you are running the adb command from the directory where your adb is located. There is tons of info on this site and google that will give you everything you need to know about using adb. Try typing the error message into search

yeah, i know to change directories already. this error is happening after i'm in the directory.
i basically start out like this:
cd C:\android-sdk-windows\tools
and after that, switch to adb shell
C:\android-sdk-windows\tools> adb shell
i get some characters and then try for a push
"adb push C:\users\myuser\downloads/avatar.apk /system/app
after that, boom! error.

bump
+10char

Oniyuri said:
yeah, i know to change directories already. this error is happening after i'm in the directory.
i basically start out like this:
cd C:\android-sdk-windows\tools
and after that, switch to adb shell
C:\android-sdk-windows\tools> adb shell
i get some characters and then try for a push
"adb push C:\users\myuser\downloads/avatar.apk /system/app
after that, boom! error.
Click to expand...
Click to collapse
You really should be using either the search bar here or google because this information is in abundance. "adb push" should not be run from inside the shell. adb is not recognized by the shell. Do the same thing that you listed above minus the step where you typed "adb shell"
********
Sent from my Paragon RC3 Captivate using the XDA app

Try 'cd C:\android-sdk-windows\platform-tools', not C:\android-sdk-windows\tools.
Better yet, just add that to the environment variable, PATH.
hth

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.

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] ADB question

Ive pushed all kinds of other stuff, I did do the add system enviromental variable to XP so this could be my issue, though like i said its worked for other things ...
ERROR I GET>
CANNOT STAT
adb push stock-hc-flyer-hboot_1.11.0006.nb0 / && adb shell dd if=/stock-hc-flyer-hboot_1.11.0006.nb0 of=/dev/block/mmcblk0p18
NO SUCH FILE OR DIRECTORY
a thourough explanation or a cut and pastable pointing my adb to this file, its in the root, the variable is to the root C also, so....
PLEASE HELP, to get me past this 10+hours of hell
May be a connection between your computer and phone issue. I have this error when I wanted to root my nexus s. Try different driver for your flyer.
Accidentally sent from my Google Nexus S using XDA Premium
Make sure the adb works via "adb devices" and "adb shell". If it does not work you can try "adb kill-server" first.
I don't think you can write (push) to "/" without "adb remount". Not sure if it is a good idea to write to root directory.
Alternatively, you can use the storage in /data/local/tmp, it is always writable.

Device won't respond to "adb shell wm" even though "wm" exists in /system/bin

Device won't respond to "adb shell wm" even though "wm" exists in /system/bin
I'm trying to change the pixel density on my unrooted RN3P using the "adb shell wm density XXX" command.
I'm running Krexus-CAF ROM.
ADB is set up and working, and I can open a shell on the device.
The problem is that `wm` cannot be found, even though it exists on the device at `/system/bin/wm`. I cannot do this with the "adb shell wm density XXX" command, nor if I open a shell on the device and type "wm density"
The output is:
Code:
~/Library/Android/sdk/platform-tools $ adb shell wm density 400
/system/bin/sh: /system/bin/wm: /bin/sh: No such file or directory
Has anyone had success with this, or can tell me why the "wm" command cannot be found, even though it exists in the directory that the device looks in?
Cheers
DoubleDroz said:
I'm trying to change the pixel density on my unrooted RN3P using the "adb shell wm density XXX" command.
I'm running Krexus-CAF ROM.
ADB is set up and working, and I can open a shell on the device.
The problem is that `wm` cannot be found, even though it exists on the device at `/system/bin/wm`. I cannot do this with the "adb shell wm density XXX" command, nor if I open a shell on the device and type "wm density"
The output is:
Has anyone had success with this, or can tell me why the "wm" command cannot be found, even though it exists in the directory that the device looks in?
Cheers
Click to expand...
Click to collapse
First check for "adb devices". If it doesn't show then check for the drivers. After that set path of adb in windows to default. Try again with debugging enabled.
mehulchirania said:
First check for "adb devices". If it doesn't show then check for the drivers. After that set path of adb in windows to default. Try again with debugging enabled.
Click to expand...
Click to collapse
thank you for taking time out to try help.
i'd just say that your solution isn't what the OP is looking for.
mainly because if you read the post he tried adb shell wm.....
but also tried on the phone inside terminal app typing the command..
i personally don't have a solution but i thought i'd try help you try maybe another suggestion?
for example, i can now go and tell the OP to download and install angry bird or busybox etc but it won't make a difference.
mehulchirania said:
First check for "adb devices". If it doesn't show then check for the drivers. After that set path of adb in windows to default. Try again with debugging enabled.
Click to expand...
Click to collapse
As noted in the question, I can definitely find my device, as I was running the shell on the device with ADB. The problem was that I could not execute `wm`, even though it was listed in the directory.
I ended up switching ROMs, and could use `wm` without issue - I'm not sure what it was about the ROM I was using that meant I couldn't use the files listed.
Oh well.

ADB + Linux error: device unauthorized

Hi
First of all, sorry for my bad english.
It has been several hours that i'm trying to find a solution to my problem.
I want to wake my nvidia shield via adb command throught network.
I installed android tools on my raspberry pi, and when i connect to it via command line everything work, i can wake up the Shield.
But when i put my command line in a bash script
Code:
#!/bin/bash
adb kill-server
adb start-server
adb connect 192.168.1.38:5555
adb shell input keyevent KEYCODE_WAKEUP
adb kill-server
i have this error :
Code:
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I dont know why, when i am execute the command line in a bash script it can't find the rsa key, who is there and should be used.
Any ideas
Thanks in advance.
darkouz said:
Hi
First of all, sorry for my bad english.
It has been several hours that i'm trying to find a solution to my problem.
I want to wake my nvidia shield via adb command throught network.
I installed android tools on my raspberry pi, and when i connect to it via command line everything work, i can wake up the Shield.
But when i put my command line in a bash script
Code:
#!/bin/bash
adb kill-server
adb start-server
adb connect 192.168.1.38:5555
adb shell input keyevent KEYCODE_WAKEUP
adb kill-server
i have this error :
Code:
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I dont know why, when i am execute the command line in a bash script it can't find the rsa key, who is there and should be used.
Any ideas
Thanks in advance.
Click to expand...
Click to collapse
Normally on Windows the first time you turn on usb debugging it will pop up and ask you to accept the adb key. This is what is preventing you, I haven't had to resolve this in Linux, but essentially you need to go to C:\\Users\You\.android\ (in Windows, path will be different in Linux) and copy the file adbkey. Now you need to move it to data/misc/adb/
This will most likely require root or TWRP. Good luck, my friend.
Sent from my KYOCERA-C6745 using Tapatalk
Hi
Thanks for your quick response.
I couldn't make the connection via USB my adb tells me that there is no emulated device. But it work with network And yeah the first time I made the connection, the authorization pop up appeared on my shield. I checked, always authorized this device.
I have the key in /root/.android on my raspberry pi
I don't think I have the access to the /data/ folder in my shield.
But what I don't understand is why when I execute the command in a terminal like that, it work and when it's from the bash script it won't work anymore
darkouz said:
Hi
Thanks for your quick response.
I couldn't make the connection via USB my adb tells me that there is no emulated device. But it work with network And yeah the first time I made the connection, the authorization pop up appeared on my shield. I checked, always authorized this device.
I have the key in /root/.android on my raspberry pi
I don't think I have the access to the /data/ folder in my shield.
But what I don't understand is why when I execute the command in a terminal like that, it work and when it's from the bash script it won't work anymore
Click to expand...
Click to collapse
Option B would be to dump your boot.img and use Assayed's kitchen to add insecure kernel and adb direct root, then the adbkey doesn't need to be on the device.
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
Option B would be to dump your boot.img and use Assayed's kitchen to add insecure kernel and adb direct root, then the adbkey doesn't need to be on the device.
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
Yeah as you said in your previous post, i think the solution is to root the nvidia shield cause the rsa key doesny copy itself on the device.
But would you able to explain to me why if i execute those command individually in the terminal it works.
But if i put them all in a bash script that i execute it doesnt work anymore, what's the difference between those two procedure ?
darkouz said:
Yeah as you said in your previous post, i think the solution is to root the nvidia shield cause the rsa key doesny copy itself on the device.
But would you able to explain to me why if i execute those command individually in the terminal it works.
But if i put them all in a bash script that i execute it doesnt work anymore, what's the difference between those two procedure ?
Click to expand...
Click to collapse
How are you executing the script? There's some (hopefully) helpful info here.
https://community.spiceworks.com/topic/433656-command-not-running-in-batch-but-will-run-in-cmd
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
How are you executing the script? There's some (hopefully) helpful info here.
https://community.spiceworks.com/topic/433656-command-not-running-in-batch-but-will-run-in-cmd
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
i m doing : sh script.sh
i m gonna read that, thanks
I found the solution.
I don't really understand why, but adding
Code:
sleep 1
before
Code:
adb shell input keyevent KEYCODE_BACK
resolved the problem, maybe the script execution was to fast for adb to adjust, dont know.
All i know is, that works
darkouz said:
I found the solution.
I don't really understand why, but adding
Code:
sleep 1
before
Code:
adb shell input keyevent KEYCODE_BACK
resolved the problem, maybe the script execution was to fast for adb to adjust, dont know.
All i know is, that works
Click to expand...
Click to collapse
Glad you got it.
Sent from my KYOCERA-C6745 using Tapatalk
sudo rm -rf /home/(username)/.android
that worked with my kde neon machine

Categories

Resources