ADB Shell (Console Commands) (ZD)
Please read the Terms of Use for Materials on ZennoLab
Table of contents
Description
Action allows you to perform built-in Android console Linux commands (this is available for the reason that Android is based on the Linux core).
Approximately the same as execution of commands in the Terminal Emulator for Android
This action is not the ADB command! It is worth perceiving as a console or an emulator terminal.
All commands are entered without ADB Shell in the beginning!
How to debug commands in cmd.exe
To train and debug commands using action is not very convenient, it is much better suitable for cmd.exe.
Running the command line
In the Windows Search panel, enter cmd.exe
(1), Right click on the command line (2) and select Run as administrator (3):
Enter the commands
To execute the commands, the virtual machine (VM) must be launched.
There are two options:
The first: can be connected to the emulator console and all subsequent commands will be performed in the context of the emulator console.
format -
<path_to_the_file_memuc.exe> -i <index_bested_VM> adb shell
, after that, all commands will be performed inside the emulator console.
Second: perform one command at a time without going into the context of the emulator console
format -
<path_to_the_file_memuc.exe> -i <index_bested_VM> adb shell ”<text_command>”
(quotes around the command are required!)
How to find out the index of interest to VM?
This information can be found in the Multi-Memu window, in the left column.
Commands
All sorts of commands a large number and to describe each of them, you need a separate reference. Here I will try to describe the most common of them.
Displays all available commands
To see the list of available commands enter in the console busybox
BusyBox - a set of unix-utilities of the command line. More details you can read in Wikipedia.
Getting tips on commands
In order to get a hint on working with a command enter <command_name> --help
, where <command_name>
- the name of the command (may not work with all commands).
Because All this is the basic Linux commands, then on the Internet a huge amount of information, instructions and explanations to work with them.
Just enter a species request in the search string linux <command_name> пример
or linux команда <command_name> пример
, where <command_name>
- the name of the required command.
List of popular commands
Команда | Описание | Пример |
---|---|---|
| Clear console window |
|
| Exit from the console of the emulator |
|
| Copy files |
|
| Displays the contents of the directory on the specified path |
|
| Moving files and directories |
|
| Deleting files |
|
| Removal of an empty directory |
|
| Creating a file |
|
| Creating a directory |
|
| Path of the current directory |
|
| Displays the current date and time |
|
| File size |
|
| List of working services |
|
Specific Android commands - am
and pm
am
Command am
- this wrapper over the class ActivityManager.
Activity
The main type of application components under Android — is activity. Activity — this is one "screen" of application. Activity can be compared with the page on the web and with the application window in the traditional window interface. Most often, the Activity window is deployed on the entire available screen.
For example, in an application for email (email client) can be such Activity as Inbox Activity (list of incoming letters), Email Activity (reading one letter), Compose Activity (writing a letter) and Settings Activity (settings).
Intent
Like pages on one site, activities of one application can be run both from each other and independently of each other (by other applications). If on the web another page is accessed by a URL (link), then in Android activities are run through intents.
Intent — it is a message that tells the system what to "do" (for example, open a given URL, write an email to a given address, call a given phone number, or take a photo).
An application can create such an intent and pass it to the system, and the system decides which activity (or other component) will handle it. This activity is launched by the system (in an existing application process or in a new one if it is not already started), this intent is passed to it, and it executes it.
pm
This command allows you to install and uninstall applications, interact with packages of installed applications (delete data, enable / disable an application), get a list of installed applications, etc.