Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ADB debugging tool in Android

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of how to use ADB debugging tools in Android, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to use ADB debugging tools in Android. Let's take a look at it.

ADB (Android Debug Bridge) is a tool in Android SDK. Using ADB, you can directly manipulate and manage Android simulators or real Andriod devices.

The main functions of ADB are:

1. Run Shell on the Android device (command line)

two。 Manage port mapping for simulators or devices

3. Upload / download files between computer and device

4. Install the local APK software on the computer to the Android simulator or device

1. Before using ADB, check whether the Android SDK toolkit has been installed in your Eclipse, as shown below:

This USB driver is also needed to connect to your Android device.

ADB is a client-server program, in which the client is the computer you use to operate, and the server is the android device.

2. If you have installed Android SDK, you can find the directory..\ android-sdk-windows\ platform-tools in your SDK directory, where the ADB tool is placed. As shown in the figure:

To copy the path to this directory, we need to set the path to PATH in the system setup of windows, and then we can use ADB in the CMD window.

3. We now start our andriod virtual machine, and then enter the CMD window.

Emulator-5554 here is my virtual machine device.

4. Commonly used ADB commands

A) adb install

This command installs the specified apk file on the device

B) adb uninstall

Adb uninstall-k

If the-k parameter is added, the configuration and cache files are retained to uninstall the software.

C) adb shell

This command will log in to the device's shell

Adb shell

After that, you will run the device command directly, which is equivalent to executing the remote command.

D) adb help

This command will display help information

C) adb push

Send files from the computer to the device

Adb remount before executing the push command, we also need to use the remount command to obtain permission to upload files, otherwise it will appear.

Error message for Read-only file system

The example is as follows

It is important to note that if you need to put files in a secondary directory, be sure to use "/" instead of "\", because android is a system under liunx, and we use windows. For example: sdcard/aa is fine, otherwise it will prompt you that you can't find it or don't have enough permissions.

D) adb get-product

Get the ID of the device

E) adb get-serialno

Get the serial number of the device

F) adb devices

Get a list of instances of the currently running simulator / device and the status of each instance

G) adb bugreport

View bug report

5. Commonly used ADB Shell commands

Enter shell through the adb shell command

A) access the database

Sqlite3

B) record wireless communication logs

Generally speaking, there are so many logs of wireless communications that there is no need to record them at run time, but we can still set up records through commands:

Logcat-b radio

C) remove the application

Android does not provide a command to uninstall the application, so you need to delete it manually:

Cd / data/app

Rm application name. apk

D) View the catalog

Ls

E) print or set the current system time

Date

F) View memory information

Cat / proc/meminfo

G) View CPU information

Cat / proc/cpuinfo

6. Delete the software that comes with Android system Rom.

a. Make sure the mobile phone root, obtained the root permission to delete the system files ah.

b. Download Android_db.rar and unzip it to% windir/%System32.

c. Connect the phone to the data cable, open cmd on the computer, and enter the command

Adb remount adb shell su

After the execution is complete, you will see:

* daemon not running. Starting it now *

* daemon started successfully *

d. Then there is the Linux command line mode. Type

Cd system/app

You will find that there is no change, then type ls and enter enter.

At this point, the list shows all the files in system/app, that is, some of the software integrated by Rom.

e. Start deleting it! For example, delete Youtube, whose filenames are Youtube.odex and Youtube.apk

We want to delete these two files and type in the following command:

Rm Youtube.*

Restart, Youtube has been deleted, pay attention to students do not delete what you do not know what it is.

7. Sqlite3 adb command

Two ways to access the database

* species: sqlite3 database name. Xx

The second kind: adb shell

Sqlite3

.databases

List database file name

.tables? PATTERN?

List? PATTERN? Matching table name

.import FILE TABLE

A file that imports data from a file.

.dump? TABLE?

Generate the SQL script that forms the database table

.output stdout

Print the output to the screen

.mode MODE? TABLE?

Set the data output mode (csv,html,tcl …

.nullvalue STRING

Replace the output NULL string with the specified string

.read FILENAME

Execute the SQL statement in the specified file

.schema? TABLE?

Print the SQL statement that creates the database table

.separator STRING

Replace the field delimiter with the specified string

.show

Print settings for all SQLite environment variables

.quit

Exit the command line interface

This is the end of the article on "how to use ADB debugging tools in Android". Thank you for reading! I believe you all have a certain understanding of "how to use ADB debugging tools in Android". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report