ANDROID_ADB Common shell commands and sqlite3 simple additions and deletions

Source: Internet
Author: User

Today I learned a common command of the ADB. Next, you'll simply use several common adb shell commands.

First, we need to understand what Adb.exe is.

Adb-android Debug Bridge is a tool in the Android SDK that allows you to manage your Android emulator or real Android device directly.

In short, the ADB is a "client (PC)-server-side (Android)" program.

Of course, the important point is that your Android device has to turn on USB debugging

The main functions of ADB are:

1. Shell running the device (command line)

2. Uploading/downloading files between the computer and the device

3. Install the local APK software into the emulator or Android device

Next we took advantage of a demo of a connection between the phone simulator and ADB.

Getting ready: Know your Android Deverlop tools (where Android development tools are located)

View Device

ADB devices

This command is to view the currently connected device, the Android device that is connected to the computer, or the emulator will list the display.

Installing the Software

ADB install <apk file path, remember to add the package name >

This command installs the specified APK file on the device.

Find out what we wrote earlier HelloWorld it automatically compiles a helloworld.apk for us.

Note: When installing, be sure to add the package name.

Of course, there are installation can also remove the software you installed

Uninstalling software

ADB uninstall < software name >

ADB uninstall-k< software name >

If you add the-K parameter, the software is uninstalled but the configuration and cache files are preserved

Login Device Shell

ADB shell

ADB shell<command Command >

This command will log on to the device's shell, followed by the <command command > will be run directly from the device command, equivalent to executing a remote command.

When you see you log in and return a command like this, followed by the # sign, you have administrator privileges.

If it appears the $ sign then you do not have permission.

Then you have to pass.

ADB root

Get Administrator privileges

You must obtain the necessary permissions when you run the file with permission issues:

To enter the relevant package directory, change the permissions command:

chmod 777 file name;

777: Representation of all rights;

Enter the database

Cd/data/data

ls--This is what you see below the data database

Let's look at the use of Sqlite3 for database additions and deletions

These are basic simple sqlite3 and additions to the grammar

For details, please refer to: http://www.runoob.com/sqlite/sqlite-syntax.html

There's a sqlite3 grammar in it.

Today, using a computer to connect mobile phone operation is a bit complicated, everyone's phone is different, there will be a lot of problems. such as no permissions, or mobile phone does not sqlite3 and so on.

In this I recommend two blog to solve the problems mentioned above have done a good answer.

Http://www.cnblogs.com/liugch/p/6077631.html

Http://www.cnblogs.com/xiaotaojing/p/6078035.html

Here are some other commands that don't show the results.

1. Download files from the device to the computer:

ADB pull < remote path >< local path >

Use the pull command to copy files or folders on your device (phone) to your local computer

2. Brush machine

The recovery brushes are usually executed in the following order:

ADB Shell Mount-a

ADB push recovery-rav1.0g.img/system/recovery.img

ADB push recovery-rav1.0g.img/sdcard/recovery-rav1.0g.img

adb shell flash_image recovery/sdcard/recovery-rav1.0g.img reboot

3. Other

Df

Top

Dumpsys Meminfo

Cat/proc/meminfo

Heap Information for Native/dalvik

If this value is found to have been increasing, a memory leak may have occurred on behalf of the program.

Kill Pidnumber

Ps/procrank See process memory

...

There are other people to check the information on their own.

ANDROID_ADB Common shell commands and sqlite3 simple additions and deletions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.