Basic adb/shell commands for noobs

Search This thread

Doyle

Member
Jul 7, 2008
6
0
... NVM

Apparently I had to go into the custom recovery console... lol
 
Last edited:

tribalartgod

Senior Member
May 12, 2010
1,163
630
Right here
Need some quick help here with ADB..

I want to change my boot animation. BUT...I want to save the one that is already on my phone first...Just in case....

How do I do this?

I have CM-5.0.8-DS currently installed


Thanks in advance
 

raven_raven

Senior Member
Apr 13, 2010
566
39
Poznań
i think not, uninstall is diferent of just delete

I think Android is different from Windows and while installing it does not make any registry entries or things like that. It only copies app to proper folder and thats it. So I assume that uninstalling will be equal to removing app files :). Maybe I'm wrong, I'm still learning how Android runs.

Need some quick help here with ADB..

I want to change my boot animation. BUT...I want to save the one that is already on my phone first...Just in case....

How do I do this?

I have CM-5.0.8-DS currently installed


Thanks in advance

I never actually changed my bootanimation, but I read few topics and instructions are always the same. You have to put bootanimation.zip to the root of sd card, then in console (or terminal app on the phone) type:



Code:
adb shell //only when using adb
$ su
# cp /sdcard/bootanimation.zip /data/local/
# reboot
 
Last edited:

spartan062984

Senior Member
Oct 8, 2010
249
7
Install apk

Hello Fellow Androids!

If this is off topic, please accept my apologies. I am searching through all of XDA for a simple solution to adding apk. Now before you start bashing, please keep in mind that I am well aware of the "search" options + google + XDA etc.

Long story short, I have:

1) Rooted
2) Fashed many Roms (currently on Stock 2.1)
3) Lag Fixxed (see signature)
4) Removed Bloatware
5) I am familiar with ABD and commands

Problem:

All I'm trying to do is install certain "apk"s using ADB. I am well aware of the Program that installs/ pushes apps automatically that are found in G1 + Vibrant + HTC + Droid Forums without having to do any typin......BUT.....I would like to know my way around ABD <----Main reason why i dont want the easy way out.

I have been here:

http://xdaforums.com/showthread.php?t=716806

as well as here:

http://xdaforums.com/showthread.php?t=743457

even been here:

http://xdaforums.com/showthread.php?t=740545

I know what you are thinking, why not use them? As i said before, i would like to be efficient with ADB. So...


I have tried methods found here:

http://xdaforums.com/showthread.php?t=517874

As well as:

http://xdaforums.com/showthread.php?t=532719


The problem I am having is:

Whether i navigate to my folder (desktop with all my apps) and use either

"adb push app /system/sd/app
adb push app-private /system/sd/app-private"

or simply

"adb install <path to file> - Example: adb install c:/apps/apps2sd.apk"

I always get the error: "cant find <whatever apk> to install"

No matter which directory i have it, i get that message.

Note:

1) I have debugging on
2) I mounted sd <----also tried Without mounting
3) I have used the same command when I removed bloatware but i understand Adding apks are slightly different.
4) I have all the drivers installed + Microsoft's .net framework + etc

What am i doing wrong?

All Critics, input, education bashing (just not hating) lol are welcome. Thanks!
 

Phateless

Senior Member
Aug 22, 2010
4,773
448
Oakland
www.llinkedin.com
Apologize if this has already been asked, but to install an app to system/app/ is just

adb install c:\app.apk to /system/app? Or do I just push it there and then it will magically appear in the app drawer?

Thanks!
 
S

shadowch31

Guest
"adb push app /system/sd/app
adb push app-private /system/sd/app-private"

or simply

"adb install <path to file> - Example: adb install c:/apps/apps2sd.apk"

I always get the error: "cant find <whatever apk> to install"

No matter which directory i have it, i get that message.

Note:

adb push c:\NameOf.apk /system/app or /data/app whichever is your preference.
adb push c:\app-private\* /data/app-private/
adb install c:\NameOf.apk /system/app/ or /data/app/

Please note the switch between windows (\) c:\ & that of Android (/) /system backslash.

I always place and copy files from c:\ and never had problems but have had the odd problem when trying to do this from sdcard.
 
Last edited:

Phateless

Senior Member
Aug 22, 2010
4,773
448
Oakland
www.llinkedin.com
So it's as simple as adding the path to /system/app when using the ADB INSTALL command and it will install it to system.

Cool, thanks.

Will I need to do anything special to remount r/w or anything like that? Still a noob with adb.
 
S

shadowch31

Guest
So it's as simple as adding the path to /system/app when using the ADB INSTALL command and it will install it to system.

Cool, thanks.

Will I need to do anything special to remount r/w or anything like that? Still a noob with adb.

Thats about it fella :D

You don't need to make system rw or anything, adb forces it's through basically.
 

duckredbeard

Senior Member
Aug 21, 2010
1,439
189
So if I want to push a .png to Tasker, I don't need to pull the app to windows? I can just push the .png to the appropriate folder/subfolder of the app? I'm dealing with Tasker and I haven't really found for sure where that is. Perhaps I can make a backup of the app, unzip it, add the file, then zip it, then reinstall it?
 

CedricAnne97

Senior Member
Apr 3, 2010
81
12
26
Puivelde
I know that this probably sounds stupid (really really stupid) but I wanna know if when they write like
$blablabla
$blablabla
if you need to do enter in between or not? + do you need to type the $? cuz I didn't ever try anything like this, but I've read allot about this so... i'm just wondering.
(please don't look at the spelling, i'm from Belgium actually + i'm only thirteen)
I read allot about this because i'm gonna buy an android phone this week :p (or next week -> an htc desire z or g2 or whatever :p i'm so happy ! lol

Thanks!!!
 
Last edited:

shourov

Senior Member
Nov 24, 2010
93
7
Dubai
i cant do anything..i cant push app or i cant mount my system...it always says that "permission denied"...whats the problem..i did everything that is needed...guys need a quick help..
 

exbarboss

Senior Member
Oct 21, 2010
74
11
Jacksonville
shell commands

Can someone helps me with scripts for android.
I need to use if loop in it.

if I use it like in linux:

Code:
if [ -f /dev/block/vold/179:2 ]; 
then 
#somecode ;
fi
then
Code:
chmod 755 $scriptname

end execution:
Code:
sh -x ./$scriptname

and when it gets to the line with if loop I get an error :not found

any ideas?
 

HumblePie

Member
Nov 27, 2006
5
0
Admins, please delete this post...

Doh. Disregard. Answered my own question...
 
Last edited:

htcjikelly

Senior Member
Mar 19, 2010
123
4
Lubbock TX
Maybe some commands on how to navigate the phone. I'm a DOS guy and the commands are similar

"dir" is "ls" for when you want a list of files and sub-directories in the current directory

"cd\" is is just "cd " (cd[space]) for changing the directory

returning to the previous directory is "cd .."

"del" is "rm" for deleting files (caution).

That's all I can think of right now.

You are the man!!!!!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 47
    Here is a list of some of the adb and terminal command I have used it Android frequently. I found that I was always having to look up these commands so I figured I would start keeping track of the common ones in case they can help anyone else. If any of these needs corrections or if you have a good one to add please post it.

    Note, I type "cd C:\Android" to get to my Android folder before doing these commands in the command prompt in windows. That way when I do things like pull apps they end up in "C:\Android\apps", same thing if I want to send I file to my phone I throw it in my Android folder and send it to the phone from there.


    Through ADB

    Pull apps off phone onto computer
    Code:
    adb pull /system/sd/app app
    adb pull /system/sd/app-private app-private

    Push apps back to phone from the computer
    Code:
    adb push app /system/sd/app
    adb push app-private /system/sd/app-private

    Delete existing apps on SD
    Code:
    adb shell rm -r /system/sd/app
    adb shell rm -r /system/sd/app-private


    Through Terminal

    Partition SD card - This erases everything on your SD card (*size* being the size of the FAT32 partition)
    Code:
    $  su
    # cd /data
    # wget http://64.105.21.209/bin/lib/droid/sdsplit
    # chmod 555 sdsplit
    # /data/sdsplit -fs *size* [I](add -nc to the end for JFv1.5ADP)[/I]


    From the Recovery Screen

    Sending an update file to your SD card:
    Code:
    adb shell mount /sdcard
    adb shell rm /sdcard/update.zip
    adb push *filename* /sdcard/update.zip


    From Fastboot

    Restoring a nandroid backup - Start command-prompt/terminal cd to the nandroid folder and enter following commands
    Code:
    fastboot erase boot
    fastboot erase recovery
    fastboot flash system system.img
    fastboot flash boot boot.img
    fastboot flash userdata data.img
    fastboot flash recovery recovery.img
    fastboot reboot
    6
    Nice list of commands, however you *might* want to remove the command to backup private apps ^_-

    Also for those who are lazier to copy and paste, you can create .bat files which you can run under Windows and it will automatically run the commands within. Simply copy and paste the commands you want to run into Notepad. Save it with a suitable name but ending with .bat, for example - Restore All Apps.bat

    It will now be changed into a batch command file so you can run it by double clicking.

    I use a slightly different method where I can put the BAT file anywhere and instead of typing "cd C:\Android" to specify a directory, I just hold down SHIFT then double click on the bat command.

    By holding down SHIFT before opening the bat file, it basically tells Windows to open the command prompt within the folder it resides in. Just another shortcut to cut down on commands :p

    I suppose you could edit the .bat script further by specifying at the start what directory you want to work with before using the adb commands. You can also make it fancy by adding a menu etc etc.

    EDIT: Last time I looked at ADB for dummies, the first post only illustrated how to get ADB working but it didn't actually have any useful commands to use at a glance.
    2
    Maybe some commands on how to navigate the phone. I'm a DOS guy and the commands are similar

    "dir" is "ls" for when you want a list of files and sub-directories in the current directory

    "cd\" is is just "cd " (cd[space]) for changing the directory

    returning to the previous directory is "cd .."

    "del" is "rm" for deleting files (caution).

    That's all I can think of right now.
    1
    just read everypage in the adb for dummies and i still dont know how to pull apps and cache to a certain folder and push them back to a new sd card
    1
    You will see your device with fastboot devices only if your phone is connected to your PC and it must be in *fastboot mode*.