Basic comands of Android SDK


ADB (Android Debug Bridge) is a tool of the Android SDK that allows us to control our Android device via a command interface. With it you can perform various tasks in a simple and fast, by simply connecting it to USB. Sometimes when we do operations «complex» with our android terminal (recovery, change spl …), and customize it a bit unofficial, pull with the copy and paste from online manuals are not sure what we are doing . ADB often used for such operations. Let’s try to learn something for next time we use the ADB.

To use the console ADB we must have downloaded the Android SDK on your computer and unzipped into a folder that is recommended for practical reasons it is in the root of your hard drive. Inside this folder of the SDK we find another folder named Tools. In this folder tools are tools to aid developers in their work to create applications, one of which is the ADB.
To use adb need to log in if you are in mac terminal or command line if we are in windows. Once inside the terminal we have to put in the folder of the SDK tools, to do with the CD command to change directory going to arrive at the tools. For example, if when you open the terminal or console comes out we see a command line like this: c :/> Program Files / My Documents / Vodafone / _ means we are within the Vodafone directory that is itself within the directory my documents turn into program files. We write cd .. and we go down a branch in the directory structure and will be in c :/> Program Files / My Documents / _, and continue until we are in c :/> and once here we write cd and name of the folder we found unzipped the android sdk, if Android sdk for example 16, you would type cd androidsdk16 and we would be in C :/> android sdk 16 / _, and continue until we are inside the tools folder within the Android.Una SDK at this time we just put adb folder and press enter we will list the options available to execute this command. The ones we use are as follows:

  • install adb adb install <path-to-apk> appmanager.apk

This option lets you install an application on your terminal.

  • adb adb push push <local> <remote> appmanager.apk sdcard / appmanager.apk

This option lets you copy a particular file in a specific location on our phone.

  • adb adb pull <remote> <local> sdcard / appmanager.apk appmanager.apk

With this we obtain copy a file from your phone to your computer

  • adb decives

It shows a list of connected terminals or emulators

  • adb shell

We see a pad on the screen, a sign that we have entered a shell session. Once inside the shell command interpreter, we can create partitions, directories, delete, create, etc

Inside the shell we use the following commands:

  • ls -> List the directories and folders in the path we are
  • reboot -> Reboot the terminal
  • rm -> Delete a file
  • rmdir -> delete a directory
  • cd -> Change directory
  • mkdir -> Create a directory
  • mkswapp -> Create a system of exchange
  • mount -> Mount a drive or partition
  • umount -> Unmount a drive
  • mv -> Move or rename a file

Examples:

  • We set Sd card to work on it
  • adb shell mount / sdcard
  • Delete the update.zip file to your phone
  • adb shell rm / sdcard / update.zip
  • Copy the file from your computer vodafone.zip our card
  • adb push vodafone.zip / sdcard / vodafone.zip
  • Dismantle our SD card
  • adb shell umount / sdcard

If you’re used to working with the commands Unix / Linux work we prove quite familiar with the console Android SDK.

Deja un comentario