BASIC COMMANDS WITH ADB FROM THE ANDROID SDK

Androidsdk

When we need change recovery in our terminals, or when we need change the SPL or use the SDK emulator, we have to lay hold of the ADB tool that comes in the Android SDK. Many times we repeat the steps that we find in the manuals or on the web without knowing very well what we are doing, today we are going to try to make us know more about what we do the next time we use the ADB.

In order to use the ADB console it is necessary that we have lowered the Android SDK on our computer and unzipped in a folder that for practical reasons is recommended to be at the root of our hard drive. Inside this folder of the SDK we find another folder called Tools. In this folder tools are the tools to help developers in their work of creating applications, one of them is the ADB.

To use adb we need to open a session in the terminal if we are on mac or in the console Android commands if we are in windows. Once inside the terminal we have to go to the tools folder of the sdk, to do this with the command CD (change directory) we change the directory until we are in the tools. For example, if when we open the terminal or the console we see that we get a command line such that: c:/>Program Files/My Documents/Androidsis/_ means that we are inside the directory androidsis which is in turn inside the directory my Documents turn inside program files. We wrote cd .. and we will download a branch in the directory structure and we will be inside c: /> Program Files / My Documents / _ , we continue like this until we are in c: /> and once here we write cd and name of the folder in which we find the android sdk unzipped, if it were for example Android sdk 16, then we would have to write cd androidsdk16 and would lead us to be in C: /> android sdk 16 / _, we continue like this until we are inside the tools folder inside the Android SDk.

Once we are in this folder, just by putting adb and pressing enter it will list the available options to execute with this command. The ones we use the most are the following:

adb install adb install appmanager.apk This option allows us to install an application on our terminal.

adb push adb push appmanager.apk sdcard / appmanager.apk This option allows us to copy a specific file to a specific location on our phone.

adb pull adb sdcard / appmanager.apk appmanager.apk With this we managed to copy a file from our phone to our computer

adb decides It shows us a list with the terminals or emulators connected.

adb shell A pound sign will appear on the screen, a sign that we have entered a command interpreter session. Once inside the shell command interpreter, we can create partitions, directories, delete, create, etc ... Inside the shell we can use the following commands:

  • ls List the directories and folders existing in the path that we are.
  • reboot Restart the terminal
  • rm Delete a file
  • rmdir Delete a directory
  • cd Change directory
  • mkdir Create a directory
  • mkswapp Create an exchange system
  • mount Mount a drive or partition
  • umount Unmount a drive
  • mv Move or rename a file

Example:

adb shell mount / sdcard (We mount the Sd card to be able to work on it)

adb shell rm /sdcard/update.zip (We delete the update.zip file from our phone)

adb push androidsis.zip /sdcard/androidsis.zip (We copy the file androidsis.zip from our computer to our card)

adb shell umount / sdcard (We unmount our SD card)

Well, I hope it helps you, if you see any incorrectness, do not hesitate to tell me, thank you.

SOURCE | android.com

 

 


You are interested in:
How to remove viruses on Android
Follow us on Google News

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Actualidad Blog
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   pepper said

    Push and pull do the same thing or do they have a difference?
    How about an article on userinit.sh or user.conf with details on how to change the swapp, activate compcache, move the cache to a class 6 sd etc….

    1.    anthocara said

      Hello
      Basically yes. About what you comment, I will do it, I did not have it in mind because as the roms are going towards a path of automatism, that lately there is nothing to do, just install them.
      But I prepare it and upload it
      All the best

  2.   beo said

    Thanks, basic but useful

  3.   beo said

    The Hero is already giving me war ...

    Before rooting it I go through this section since I am trying to change the recovery which takes me to my first steps with the ADB. I access from WinXP from cmd to ADB, after installing the USB drivers from the SDK, and I do an «adb devices», «adb shell» and there is no way the driver is installed but it seems that it does not detect it well or I don't know ... say I have a 64-bit WinXP, maybe this driver has problems? 🙁

  4.   rebel said

    hello, how are you? htc and nothing else is that I do not handle the adb shell commands well and I do not know how to install the rom that had it again. I hope you can help me thanks

  5.   James rivadeneyra said

    Don't you know of a command or the edition of a file that allows you to configure the path where the files that the cell phone receives via bluetooth are recorded?

  6.   Gualberto Elias Moretta said

    I really understood, now I follow you on twitter

  7.   faith said

    adb shell mount / system / framework (we mount the folder in R / W)

    adb push / system / framework

    Is it necessary to unmount the / system / framework folder? Is this script correct?
    Thanks: D

  8.   JR ORTIZ said

    As I can change the permissions of a file (in my case .db), I am trying with $ chmod 777

  9.   jm said

    Hello I have understood a lot of your tutorial but I have one doubt, If I transfer the files or folders from the mobile to the computer then I can edit them with a program on the PC.
    Thank you