ADB Shell not working, but my N1 isn't bricked - Nexus One Q&A, Help & Troubleshooting

I wanted to use USB Tunnel to share my PC's internet connection with the phone, but I got the error:
Code:
- exec '/system/bin/sh' failed: No such file or directory (2) -
I tried to install other APK's through ADB and they also failed, so I googled this error and I saw that the main issue is a failing ADB Shell. I tried to open Shell and I got the same error. The difference between me and the other users is that my phone is booting as usual, USB Mass Storage works, the phone is detected by fastboot- and adb devices commands and everything is working as intended, except for installing APKs through ADB/opening Shell.
Here is my phone's current config:
MeDroidMod 1.4.4 w/ HWA
Latest Tiamat kernel
TexasICE HBOOT w/ 210/8/218 partition layout
4GB microSD card...I don't know the filesystem but it's definitely NOT ext4, so there's not A2SD for me (I think it's FAT or FAT32)
ClockWorkMod Recovery

gnexus47 said:
I wanted to use USB Tunnel to share my PC's internet connection with the phone, but I got the error:
Code:
- exec '/system/bin/sh' failed: No such file or directory (2) -
I tried to install other APK's through ADB and they also failed, so I googled this error and I saw that the main issue is a failing ADB Shell. I tried to open Shell and I got the same error. The difference between me and the other users is that my phone is booting as usual, USB Mass Storage works, the phone is detected by fastboot- and adb devices commands and everything is working as intended, except for installing APKs through ADB/opening Shell.
Here is my phone's current config:
MeDroidMod 1.4.4 w/ HWA
Latest Tiamat kernel
TexasICE HBOOT w/ 210/8/218 partition layout
4GB microSD card...I don't know the filesystem but it's definitely NOT ext4, so there's not A2SD for me (I think it's FAT or FAT32)
ClockWorkMod Recovery
Click to expand...
Click to collapse
Which adb commands did you use? Can you list the commands here that you had used? It could be that you didn't issue su command to get superuser rights?

you don't need to be in Shell to push apk
put the apk on your C: drive
open command window and navigate to the folder you have adb/fastboot in--normally tools of your sdk
then:
type adb devices--then
1. adb remount
2. adb push C:/CalendarGoogle.apk /system/app/CalendarGoogle.apk
3. adb push C:/CalendarProvider.apk /system/app/CalendarProvider.apk
4. adb shell
7. chmod 777 system/app/CalendarGoogle.apk
11. chmod 777 system/app/CalendarProvider.apk
12. exit
13. Reboot
use the apk name of whatever you are flashing in place of mine and your chmod may not be exactly like mine--

ADB Shell
rugmankc said:
you don't need to be in Shell to push apk
put the apk on your C: drive
open command window and navigate to the folder you have adb/fastboot in--normally tools of your sdk
then:
type adb devices--then
1. adb remount
2. adb push C:/CalendarGoogle.apk /system/app/CalendarGoogle.apk
3. adb push C:/CalendarProvider.apk /system/app/CalendarProvider.apk
4. adb shell
7. chmod 777 system/app/CalendarGoogle.apk
11. chmod 777 system/app/CalendarProvider.apk
12. exit
13. Reboot
use the apk name of whatever you are flashing in place of mine and your chmod may not be exactly like mine--
Click to expand...
Click to collapse
I don't use ADB Shell to push APK's. That's just another thing which doesn't work.
@taodan: I only use: adb install xxxxx.apk.

A work around is to mount the sdcard and drag and drop the apks to the sdcard. Then install using your favorite file manager.

evilkorn said:
A work around is to mount the sdcard and drag and drop the apks to the sdcard. Then install using your favorite file manager.
Click to expand...
Click to collapse
that will work too, i've used root explorer to copy paste from sdcard to correct file location. prefer adb. set your permissions after
did you try adb remount first, not sure if that would help
what i was saying is you don't need to type adb shell. assuming you are doing this from a pc command terminal window.
you can use the commands I gave above to push apk. i think when you push it copies apk to phone leaving apk on pc also. install actually moves it to phone--as i understand it
here is some links and info that might help.*
http://www.talkandroid.com/guides/beginner/install-apk-files-on-android/#.T2-cdaJST3U
http://www.brighthub.com/mobile/google-android/articles/37151.aspx
also, have you ever had luck installing/pushing apk's. you may not have the correct environmental path on pc or are typing incorrect path in your command line
you can google environmental path editing for android and get examples of how to do it--i am not even sure mine is set right since I still have to type the full path in command window to use adb
sorry if this is old news just trying to find your problem

Related

ADP pull/push ISSUES

ok so I got adb working fine .. but apparently I have NO idea on how to properly pull and anything from the phone or push to the phone what I saw was something about adb pull system/sd/app app and then I have seen adb pull system/sd/app/app which BOTH give me the adb: not found
then I have created a folder named android on my C:
then I tried the cd C:\android adb pull /system/sd/app/app and that gives me a bad substitution
I have also tried the adb pull system/sd/app/app cd C:\android .. this also gives me that bad substitution error
so what I NEED is SOMEONE to give me SPECIFIC examples of this
so i am asking for 2 exapmles
one to pull the calcultor from the phone to the comp
second is to pull an installed app like chompsms from the phone to the comp
I am doing all of this from the #
I have searched google and cannot find ANYTTING on this
I have searched here and found nothing
I have read the adb for dummies and the adb useful commands
any help on this would be great
also I have done the cd data then cd app and then when I get to the cd ls is says cannot cd into ls
But when I just ls I get the apps list
I am using vista 64 too
BTW I am using the 1.5MOD from lucid and I do have my apps to the sd card by using his lucid script
Strapt said:
BOTH give me the adb: not found
Click to expand...
Click to collapse
Put the path to your folder with adb in it in your system path directory. Instructions from the android dev site:
Optionally, you may want to add the location of the SDK's primary tools directory to your system PATH. The primary tools/ directory is located at the root of the SDK folder. Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory.
On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:<your_sdk_dir>/tools
On a Mac, look in your home directory for .bash_profile and proceed as for Linux. You can create the .bash_profile if you haven't already set one up on your machine.
On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools/ directory to the path.
Click to expand...
Click to collapse
then I have created a folder named android on my C:
then I tried the cd C:\android adb pull /system/sd/app/app and that gives me a bad substitution
Click to expand...
Click to collapse
Adb push/pull requires two arguments, the source and the destination. E.g. on windows:
adb push \completely_legit_apps\gamelofd-monopolizing.apk /data/app/mono.apk
-or-
adb pull /system/app/Mail.apk \roflmao_i_ripped_exchangemail.apk
Notice that on the Android side, the path delimiter is the forward slash (/), whereas on the Windows side it's backslash (\).
Edit: also, on windows if you don't specify an absolute path, it is taken as being relative to your usr directory:
adb push \app.apk <-- pushes c:\Documents and Settings\username\app.apk, NOT c:\app.apk
^above^
But this is also in the wrong forum! This belongs to Q&A.
jashsu said:
Put the path to your folder with adb in it in your system path directory. Instructions from the android dev site:
Adb push/pull requires two arguments, the source and the destination. E.g. on windows:
adb push \completely_legit_apps\gamelofd-monopolizing.apk /data/app/mono.apk
-or-
adb pull /system/app/Mail.apk \roflmao_i_ripped_exchangemail.apk
Notice that on the Android side, the path delimiter is the forward slash (/), whereas on the Windows side it's backslash (\).
Edit: also, on windows if you don't specify an absolute path, it is taken as being relative to your usr directory:
adb push \app.apk <-- pushes c:\Documents and Settings\username\app.apk, NOT c:\app.apk
Click to expand...
Click to collapse
ok so I am trying to pull the Mms.apk to the comp into my C: documents
So I got
# adb pull /system/app/Mms.apk ... then what exactly would I need to finish the rest? how would that look whole?
My Mms.apk is in system/app in my phone and I do have apps to sd if that makes a diff
also .. if I pull this does that completely remove it from the phone? assuming it would
I keep getting adb not found But I can type lucid and it shows the lucid comands and reboot and it reboots ... so i am connected ...
Strapt said:
ok so I am trying to pull the Mms.apk to the comp into my C: documents
So I got
# adb pull /system/app/Mms.apk ... then what exactly would I need to finish the rest? how would that look whole?
My Mms.apk is in system/app in my phone and I do have apps to sd if that makes a diff
also .. if I pull this does that completely remove it from the phone? assuming it would
I keep getting adb not found But I can type lucid and it shows the lucid comands and reboot and it reboots ... so i am connected ...
Click to expand...
Click to collapse
adb pull /system/app/Mms.apk temp/
Of course, you can substitute temp with any folder you want (by default, you will save it under the folder that adb is located in,
so the command above would push the file to /adb directory/temp
Like that.
Its might be saying that its not there, because its not there, with apps2sd it should be located under /system/sd/app_s/Mms.apk (but of course this differs from build to build)
and no, I don't think it will remove it, it should still be there, to remove it you have to type:
adb shell rm /system/sd/app_s/Mms.apk
h.nocturna said:
adb pull /system/app/Mms.apk temp/
Like that.
Its might be saying that its not there, because its not there, with apps2sd it should be located under /system/sd/app_s/Mms.apk (but of course this differs from build to build)
and no, I don't think it will remove it, it should still be there, to remove it you have to type:
adb shell rm /system/sd/app_s/Mms.apk
Click to expand...
Click to collapse
ok so I tried both the
/system/app/Mms.apk temp/
and the adb pull /system/sd/app_s/Mms.apk temp/
BOTH I get adb not found
Do i need to add something like cd C:\Documents adb pull /system/app/Mms.apk ??? (which If I do that I get a bad substitution error or a directory not found .. which it is in there)
when I go thru astro the path is system/app then I see all the stock apps and the odex files
EDIT: some I have seen have been adb pull /system/app/Mms.apk/Mms.apk OR adb pull /system/app/Mms.apk Mms.apk .. those I still get adb not found
EDIT EDIT: hell even adb remount gets me adb not found ... and the cd ls gets me cant cd into ls
EDIT EDIT EDIT: ok so i tried to change the dir to where the file goes. So I created a Documents folder in root of my C drive. Then I used the adb pull /system/app/Mms.apk Documents\ and I got a > and nothing is in my folder I changed the direction of the last \ after Documents
I got it!!! this worked!!!
adb pull /system/app/Mms.apk \Documents WORKS!!! NOT FROM THE#!!!
Strapt said:
I got it!!! this worked!!!
adb pull /system/app/Mms.apk \Documents WORKS!!! NOT FROM THE#!!!
Click to expand...
Click to collapse
I think you should learn more about command prompts and linux shell commands
other than that, good for you.
glad it worked for you. If i wasn't clear, I meant that you should've cd to the location of adb on your computer through command prompt, then from there run the commands that I outlined above.
h.nocturna said:
glad it worked for you. If i wasn't clear, I meant that you should've cd to the location of adb on your computer through command prompt, then from there run the commands that I outlined above.
Click to expand...
Click to collapse
ok so like what ya mean?
from the
C:\Users\Owner
I do then "cd C:\android-sdk-windows-1.5_r2\tools"
and that takes me to the plain C:\android-sdk-windows-1.5_r2\tools
so from here what would you type in to cd and cd into what?
apparently the problem what that I typed adb shell and then was doing everything from the comand prompt and that didnt work.
ok so I think I figured out what you mean.
I did type the cd C:\Documents then I get the C:\Documents> and from there I can run just the adb pull /system/app/Mms.apk Mms.apk
now that I have that working I have to try the push now
so with the same example above I would:
again cd C:\Documents
then
adb push Mms.apk /system/app/
is that right or should that be different?
ok so here is a question
I did mange to find where my downloaded apps are going by mounting the volumes onto ubuntu. which is /media/disk-1/app and this is in my ext2 partition
but I cant seem to be able cd to the /media/disk-1/app everytime it says cant cd to /media/disk-1/app
trying to do two things
one is trying to cd into that path so I can ls
and also trying to see how I would be able to pull apps that I have downloaded
I have kinda figured out the other pull but now would like to know why this isnt working.
Strapt said:
ok so I think I figured out what you mean.
I did type the cd C:\Documents then I get the C:\Documents> and from there I can run just the adb pull /system/app/Mms.apk Mms.apk
now that I have that working I have to try the push now
so with the same example above I would:
again cd C:\Documents
then
adb push Mms.apk /system/app/
is that right or should that be different?
Click to expand...
Click to collapse
adb should only work from whatever location you put the adb.exe, so for instance, I'm assuming that you put adb in c:\Documents. Then you would type cd c:\documents and run your adb commands there, and adb will treat c:\Documents as your root folder (which is why everything transfers to c:\Documents by default for you). Therefore, the push commands will also treat c:\Documents as your root folder, so you can only push whatever is in c:\Documents. So transfer whatever file you want to be pushed to c:\Documents and then adb push file within c:\Documents /wherever you want it on the phone
h.nocturna said:
adb should only work from whatever location you put the adb.exe, so for instance, I'm assuming that you put adb in c:\Documents. Then you would type cd c:\documents and run your adb commands there, and adb will treat c:\Documents as your root folder (which is why everything transfers to c:\Documents by default for you). Therefore, the push commands will also treat c:\Documents as your root folder, so you can only push whatever is in c:\Documents. So transfer whatever file you want to be pushed to c:\Documents and then adb push file within c:\Documents /wherever you want it on the phone
Click to expand...
Click to collapse
well actually I made the Documents folder and its completely empty
the actual adb.exe is in the C:\android-sdk-windows-1.5_r2\tools\adb.exe
I think that I have copied and pasted that and some win something .dll into system32 folder. not sure if that makes a difference or not.
from my understanding I can now change it to whatever folder I want to move the files to on my comp just by typing the location and folder name and not just to the Documents folder.
also when I am at the C:\android-sdk-windows-1.5_r2 in cmd what is that line called or the commands that you do from that line called? and the pull push has to be from this line right?
Im guessing that the adb shell is the linux shell commands which is the # right?
also I would to really like to say thank you for your continued help on this!!
Its no problem, placing it in system32, allows you to use adb.exe straight from the console so its alright. But instead of cd(ing?) to whatever location the adb.exe is located, just cd to wherever you want to pull the files or wherever the files you want to push are and then just run the commands outlined above for pushing/pulling files.
the # denotes that you have entered the phone's terminal with root permissions. Yes, it is linux.
Yes the commands must be typed from the command prompt so:
C:\Documents>adb pull /system/sd/app_s/Mms.apk C:\Documents
or wherever you want, just replace C:\Documents with whatever you want.

trying to adb push an xml file to g1

hi, i'm running cm5 test 4 on my g1 and for the most part it's been great...except for the slow market...so i did my research and found that there's an xml file that you can push to fix this issue-http://www.google.com/support/forum/p/Android+Market/thread?tid=1ea082d443f3d16c&hl=en...so i copied the file, named it "marketfix" and stuck it in C:...tried to adb push it like this - adb push C:\marketfix.rtf /data/data/com.android.vending/shared_prefs/vending_preferences.xml - but after that i get an "adb: not found"...what did i do wrong? any help would be appreciated...thanks in advance!
naars90 said:
hi, i'm running cm5 test 4 on my g1 and for the most part it's been great...except for the slow market...so i did my research and found that there's an xml file that you can push to fix this issue-http://www.google.com/support/forum/p/Android+Market/thread?tid=1ea082d443f3d16c&hl=en...so i copied the file, named it "marketfix" and stuck it in C:...tried to adb push it like this - adb push C:\marketfix.rtf /data/data/com.android.vending/shared_prefs/vending_preferences.xml - but after that i get an "adb: not found"...what did i do wrong? any help would be appreciated...thanks in advance!
Click to expand...
Click to collapse
Either you don't have adb installed, you didn't set it up correctly, or you aren't in the directory where adb is installed.
Solutions are: Setup adb, set it up correctly, or change your directory in your cmd prompt to the directory where the adb.exe file is located.
Additionally, make sure you aren't entering the command superfluously like:
Code:
adb shell
adb push blah blah blah
You can't push files from within adb so once you open you cmd prompt and navigate to the correct directory do adb push directly from there, don't try and go into the shell and then execute adb push like I outlined above

[Q] Please help with general questions!

Ok so i am trying to install this boot animation and have questions. I am a noob so this is all kind of new to me. My hero is rooted and I have fresh 2.3.3 installed on it. There directions for installing this animation are as followed.
Directions:
1. Put the zip file in your tools folder from the android-sdk-windows
2. Load up Command Prompt (cmd) and go to your tools directory inside the android-sdk-windows folder
3. Load up your phone into recovery and mount /system
4. Type in command prompt
adb remount
adb push bootanimation.zip /system/media
adb reboot
What does it mean on #2? I know how to load cmd but then how do it get to that folder and mount the system? I am so lost. I just thought i could plug my phone into the usb and load cmd and start the adb commands. How do i get this adb commands to work? I was also wanting to remove some stock apps from another thread which stated to just type adb commands but i get nothing. Can you please help me to understand this or atleast point me in the right direction? Thanks in advance!
#2 means navigate to your Android SDK / tools folder, wherever you installed it on your PC. At the C:/ prompt, type
Code:
cd c:\android-sdk-windows\tools
or whatever directory it is for you. Then all the adb commands should work.
EDIT: Your phone has to be turned on for adb to work, and it's a good idea to have it in "Charge Only" USB mode so that there won't be any SD card conflicts.
Awesome, thanks for your response. But then on the second part of my question where do i go to start typing commands for this one:
To remove an app from your phone you must have root access and type the following commands with SU access:
type:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Then type:
cd /system/app
then you can type "ls" to list the contents of the directory.
Where is it referring to "type" at? Sorry if i sound like such a noob but I am.
Questions answered over PM. All resolved.

Please help with installing latinIME.apk?

I really like the black keyboard from SuperCM7 rom. I tried replacing the latinIME.apk in system/apps but then I end up not having a keyboard and if I try installing it says not installed.
Sent from my Nexus S using Tapatalk
I know how from windows and SDK required
put the new LatinIME.apk file into your sdk/tools/ dir located on your PC
reboot phone into into CWR ...make sure phone is plugged into PC
select "mounts and storage" then select "mount system"
from windows run CMD and locate sdk/tools dir
then run these commands
adb remount
adb shell rm -r /system/app/LatinIME.apk - Skip this step you already removed all remnants of LatinIME from app dir
adb push LatinIME.apk /system/app/LatinIME.apk
reboot phone and will be allset
double post
demo23019 said:
I know how from windows and SDK required
put the new LatinIME.apk file into your sdk/tools/ dir located on your PC
reboot phone into into CWR ...make sure phone is plugged into PC
select "mounts and storage" then select "mount system"
from windows run CMD and locate sdk/tools dir
then run these commands
adb remount
adb shell rm -r /system/app/LatinIME.apk - Skip this step you already removed all remnants of LatinIME from app dir
adb push LatinIME.apk /system/app/LatinIME.apk
reboot phone and will be allset
Click to expand...
Click to collapse
I tried and it kept saying invalid command
not sure...those are the correct commands for removing and pushing files
just an FYI the file name is cap sensitive

[GUIDE][ADB]Easiest How to use adb, logcat, etc for noobs and newbies

ADB:-
Android Debug Bridge
Very useful program made itself by Google for Programmers and developers. Its based on command line and basically communicates with your Android to respond to certain commands. There is vast amount of knowledge about adb but its most useful commands limit to getting:-
Logcat:-
A real time log of what is happening in background of our devices. It is really useful for developers to see which component has malfunctioned and helps to narrow down their search for what failed and what needs to be fixed. Several times users are asked to give logcats of their devices which are giving errors. We will go in detail that how to get logcats in every and easiest way possible.
App Installation and Management:-
adb proves really handy if you want to install apks directly from your PC or want to batch install or delete them.
Shell Execution:-
You must have heard of Terminal Emulator. It is an app for android to execute shell commands(linux commands) which are basically present as applets in /system/bin, /system/sbin or /system/xbin(in our case) folders. A very imporant applet called busybox is installed there mainly used for execution of basic commands during root browsing or ROM installation. Many times updater script of ROMs use busybox commands to install it. Well, these commands can be initiated from your device too but they can be initiated from adb also making it easy for programmers.
Pushing and Pulling:-
Most used commands of adb. adb makes it a piece of cake for new device developers to get an ideo of structure and basic knowledge of devices by pulling command. We can pull out i.e copy any files or folders from our devices to our PC, even the root directories without rooting the devices. It help rooters and ROM chefs of new devices to get an idea and implement their mods on them. Pushing is also very useful command. It copies your files and folders from PC to your device. Very useful in pushing some /system apps and other things
Remounting and setting permissions
Basic commands:-
Of-course basic commands such as rebooting and rebooting in recovery mode and download mode are supported.
Others:-
There are several other features of adb such as fastboot, aapt, etc
Setting up ADB
Pre Requirements:-
PC(This is a windows guide, if asked I will add linux and mac guide later)
Java Runtime environment or Java Developing kit
Your Device Drivers
An Android Device
USB Debugging MUST be turned ON in the device for ADB to see it & Developer options is hidden in Android 4.2 and
above, Hitting Build number 10 times in
About Phone/Tablet reveals the menu (Thanks lilHermit for reminding me to add it)
Assuming you all these ready and working properly, we continue
If you are having trouble completing Pre-Requisites, there are several guides featuring them too
Start
1. First Download Android SDK. Roughly about 70 MB
2. There may be any compressed zip file or exe file
If zip file, then extract it to C:\android-sdk
If exe file then double click on it and install it in C:\ Drive(or any other drive you want)
3. Now to get adb and other tools, you need to download 'Platform Tools'
To download them, go to the android-sdk folder and double click on SDK Manager
It will ask you which package to download? However, it is your choice which package to Download, but here, we will only talk about platform
Tools. So, simply tick on Platform Tools and click on install. Once you have done it. Go to the platform-tools folder in the directory where you installed android-sdk. You will find several files there like adb, fastboot, aapt, etc
4. Now, you can backup the whole folder of android-sdk to any external storage that will make you not download package
again if you want to. You can have it placed in any computer and run it as it does not require registry to work
5. Now, you are just one step away from using adb. Next step is SKIPPING SETTING ENVIRONMENT VARIABLE (If you however want to set environment variables. Click on Show Content)
We can easily append the sdk platform-tools and tools folder to your systems environmental path variable directly from command line(cmd) by simply issuing one command and performing a system reboot:
Code:
[COLOR=Black]SETX PATH "%PATH%;[/COLOR][COLOR=Indigo]SDK_Install_Path[/COLOR][COLOR=Black]\platform-tools;[/COLOR][COLOR=Indigo]SDK_Install_Path[/COLOR][COLOR=Black]\android-sdk-windows\tools" -m[/COLOR]
Just replace the "SDK_Install_Path" in the above with the proper path of your SDK installation. Example: C:\android-sdk-windows
(Thanks to WugFresh for telling me :victory
Many guides on internet say that it is to be done for making it easy for users and if you have some basic knowledge of Command Prompt,
you will know that to execute any application with command prompt, you first need to change the directory to the one where application is
placed. And to skip changing the directories every time you open CMD, you need to put that application is environment variable. However, we will not do so.
6. Type cmd in the search bar. Copy cmd.exe from there. Go to the directory where you have installed android-sdk. Go to platform-tools folder. Paste cmd there, right click on it and in the settings, select Run as Administrator.
7. You are done. Now what to do in it?
ADB Commands
Type adb in command prompt. And several commands will show up on your screen. It is very difficult to analyse these all commands, so we will only talk about most used and important commands
Connect your device via USB cable
And open the CMD in platform-tools folder(Make a shortcut of it on desktop). And type the suitable commands
Code:
adb devices
Will show the list of devices attached to the PC andtheir serial numbers. If this shows up correctly on your PC, then it means that everything is fine for continuing.
Logcat
Code:
adb logcat
It will display the real time log of your device
Best time to do it is when your device boots up
Now, many users ask me how to copy the logcat and upload it from CMD
There are several methods:-
1. Right click on the Title Bar of Command Prompt. Hover the cursor over edit and select mark. Select all the things you want to copy and then click enter. All the things will be copied to clipboard.
2. This is the correct way of getting logcat saved.
Code:
adb logcat > logcat.txt
This command will create a logcat.txt document in platform-tools folder with the complete logcat of the device. Ofcourse you can type any name instead of logcat.txt
3. I prefer taking logcat this way as it neatly compiles logs of different time
Code:
adb logcat -v long > logcat.txt
This is a very nice way to get logcat.
Installing Apps
Code:
adb install %PATH OF APK%
This will install an app on your Android
For example, if my app AreeB.apk is in G:\ drive (G:\AreeB.apk)
Then I will type
Code:
adb install G:\AreeB.apk
Be sure your apk is not in a folder that has space in its name, else the command will break at space bar.
For eg:-
G:\Program Files\AreeB.apk
Note:
If you have spaces in path of apk, you can execute the command without breakage if you include the path inside quotes. (Thanks to etcman)
Eg:-
Code:
adb install "G:\Program Files\AreeB.apk"
Mounting
However, I never found any problem in tweaking with system files with adb, but some users said that they couldn't do it, so the problem was that their system partition was mounted as Read Only(R/O)
So, it is necessary now to tell how to mount system partition as Read Write(R/W)
Code:
adb remount
It is easiest way to do so, if it does not work then
There is another method that we will discuss in ADB Shell commands section
Pushing and Pulling
For pushing,
Type
Code:
adb push %PATH TO BE PUSHED% %PATH WHERE TO BE PUSHED%
Suppose I have an app named SystemUI.apk(PATH = G:\SystemUI.apk) which I want to push in /system/app/ on my android(or in other words, install an app as a system app). Then I would type
Code:
adb push G:\SystemUI.apk /system/app/
More examples
G:\Dance.txt file to be pushed in Dance folder in sdcard
Code:
adb push G:\Dance.txt /sdcard/Dance/
OR
Code:
adb push G:\Dance.txt /mnt/sdcard/Dance/
G:\Movies folder to be transferred in SDCARD in Videos Folder
Code:
adb push G:\Movies /sdcard/Videos/
G:\system\framework\framework-res.apk to be pushed in /system/framework/
Code:
adb push G:\system\framework\framework-res.apk /system/framework/
For pulling,
push command replaces with pull and paths are swapped​
Code:
adb pull %PATH TO BE PULLED FROM% %PATH TO PLACE PULLED FILE%
Example,
All system apps are to be pulled to G:\ROM\system\app
Code:
adb pull /system/app G:\ROM\system\app\
build.prop to be extracted to desktop
Code:
adb pull /system/build.prop C:\Users\Areeb\Desktop\
However, if a folder is in platform-tools folder, you don't need to type full path
Suppose if I type
Code:
adb pull /system/ system
Then a folder named system will be created inside platform-tools with all the files in system in it
If a file is in platform-tools folder, then also no need to type full path
For example,
There is an app name DeskClock.apk in this folder then, to push it to /system/app, type
Code:
adb push DeskClock.apk /system/app/
ADB Shell Commands
This mode of adb allows you to execute linux shell commands from your PC
These commands can aldo be executed through the mobile using Terminal Emulator
To initiate shell mode
Type
Code:
adb shell
You will get an prompt like this
sh-3.2#
Now you are in shell mode
adb commands won't work here and a new set of commands will work here. But we will only go in a little detail here.
Assuming you are in adb shell mode, I will only type commands that will work on shell. Note:- These commands won't work if you type them alone on cmd. But, these command will directly work on your mobile's Terminal Emulator
As these commands can also work on mobile, I am going to tell you a way of taking logcat on mobile
Type
Code:
logcat
You will see log of your device
To save this
Type
Code:
logcat > /sdcard/log.txt
A file named log.txt will be generated in sdcard
Uninstalling Applications
Code:
cd /data/app
This will change the directory to /data/app
Code:
ls
This will show the list of files in there
Suppose, there is an app named com.opera.browser (Opera Mobile) you want to uninstall it
Type
Code:
rm -r com.opera.browser
This will uninstall the app
Mounting Command:-
Code:
mount -o rw,remount /dev/block/mtdblock3 /system
Miscellanous commands:-
su: Initiates root request
du: Shows file foldrs and size
date: Shows todays date
ls: Shows list of directory
cd: Changes working directory
rm: Removes the file
logcat: Displays logcat
mount: Mounts the partition
busybox: Busybox Applets
Credits
Google: For Android and several searchings
Samsung: For Galaxy Ace s5830I
paxChristos for amazing logcat guide
Broadcom: For their Open Sourceness
XDA Forums : For the precious knowledge
Reserved
Reserved Once More
Last One
Reserve the guide
install full rom
how to install a full rom from adb?
Pretty sure it's impossible. Sorry.
Sent from my E15i using XDA Premium App
Perfect Guide to use ADB Commands..
It is very clear and perfect guide to use ADB commands.. I tested this all and works fine..
You can use apks to do logcats from the phone too, I use catlog.
About Broadcom being open sourced made me laugh hahaha.
open source broadcomm, i see what you did there .
Updated OP
Hey, I have downloaded adb a week ago. I did everything like your tutorial and more but adb doesn't see my device. I already have USB Debugging on and have the USB Drivers, but it doesn't work. This is what I get (Screenshot)
Android-fany said:
Hey, I have downloaded adb a week ago. I did everything like your tutorial and more but adb doesn't see my device. I already have USB Debugging on and have the USB Drivers, but it doesn't work. This is what I get (Screenshot)
Click to expand...
Click to collapse
Probably because of bad drivers
Can you use any other software with your mob
Because when I had this problem, reinstalling drivers fixed it.
iamareebjamal said:
Probably because of bad drivers
Can you use any other software with your mob
Because when I had this problem, reinstalling drivers fixed it.
Click to expand...
Click to collapse
I already reinstalled it like 5 times. Still doesn't work.
Android-fany said:
I already reinstalled it like 5 times. Still doesn't work.
Click to expand...
Click to collapse
Which Windows?
Which ROM?
iamareebjamal said:
Which Windows?
Which ROM?
Click to expand...
Click to collapse
Windows Vista
Stock Rom + Interactive Kernel (If the kernel is important too)
Android-fany said:
Windows Vista
Stock Rom + Interactive Kernel (If the kernel is important too)
Click to expand...
Click to collapse
Ah Vista
That old Nemesis
Frankly telling you bro, Vista sucks big time
I unistalled it as soon as I found out that Android kitchen won't work on it
Sorry bro
I don't know much about Vista
Install 7 or 8
AW: [GUIDE][ADB]Easiest How to use adb, logcat, etc for noobs and newbies
iamareebjamal said:
Ah Vista
That old Nemesis
Frankly telling you bro, Vista sucks big time
I unistalled it as soon as I found out that Android kitchen won't work on it
Sorry bro
I don't know much about Vista
Install 7 or 8
Click to expand...
Click to collapse
I can't install Windows 7/8 because it is not my computer.
But Android Kitchen and the other tools works. Just not adb.
Tapatalked by s5830i
Android-fany said:
I can't install Windows 7/8 because it is not my computer.
But Android Kitchen and the other tools works. Just not adb.
Tapatalked by s5830i
Click to expand...
Click to collapse
Very strange
Download My Phone Explorer and check if its working!!
Its just 2mb-6mb

Categories

Resources