ADB (Android Debug Bridge) is a tool in the Android SDK. ADB can be used to directly operate and manage the Android emulator or a real Andriod device. The main functions of ADB are: 1. Run Shell (command line) on Android device 2. Manage port mappings for simulators or devices 3. Upload/download files between computers and devices 4. Install the local APK software on the computer to the Android emulator or device 1. Before using ADB, first check whether the Android SDK toolkit has been installed in your Eclipse , as shown below: This USB driver is also needed to connect your Android device. ADB is a client-server program, where the client is the computer you use to operate it, and the server is the Android device. 2. If you have installed the Android SDK, you can find the directory ..\android-sdk-windows\platform-tools in your SDK directory . The ADB tool is located here. As shown in the figure: Copy the path of this directory. We need to set this path to PATH in the system settings of Windows. After the setting is completed, we can use ADB in the CMD window. 3. We now start our andriod virtual machine and enter the CMD window. The emulator-5554 here is my virtual machine device 4. Commonly used ADB commands a) adb install <apk file path> This command installs the specified apk file on the device b) adb uninstall <software name> adb uninstall -k <software name> If you add the -k parameter, the software will be uninstalled but the configuration and cache files will be retained. c) adb shell This command will log in to the shell of the device adb shell <command> Adding <command> at the end will directly run the device command, which is equivalent to executing a remote command d) adb help This command will display help information. c) adb push <local path> <remote path> Send files from your computer to your device adb remount Before executing the push command, we also need to use the remount command to obtain the upload file permission, otherwise Read-only file system error message The example is as follows It should be noted that if you need to put a file in a secondary directory, you must use "/" instead of "\", because Android is a Linux system, and we use Windows. For example: sdcard/aa, otherwise it will prompt that it cannot be found or the permission is insufficient. d) adb get-product Get the device ID e) adb get-serialno Get the serial number of the device f) adb devices Get a list of currently running emulator/device instances and the status of each instance g) adb bugreport View bug report 5. Commonly used ADB Shell commands Enter the shell through the adb shell command a) Accessing the database
b) Record wireless communication logs Generally speaking, there are a lot of wireless communication logs, and it is not necessary to record them during operation, but we can still set the logs through commands:
c) Delete the app Android does not provide a command to uninstall the application, you need to delete it manually:
rm application name.apk d) View the directory
e) Print or set the current system time
f) View memory information
g) Check CPU information
6. Delete the software that comes with the Android system Rom a. Make sure your phone is rooted and you have root permissions to delete system files. 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
After the execution is complete, you will see: * daemon not running. starting it now * * daemon started successfully * d. Then it is Linux command line mode, enter
You will find that there is no change, then enter ls and press Enter. At this time, the list shows all the files in system/app, which are some software integrated by Rom. e. Start deleting! For example, if you want to delete Youtube, its file names are Youtube.odex and Youtube.apk We want to delete these two files, type the following command:
Restart, Youtube has been deleted. Please note that students should not delete anything you don’t know what it is. 7. sqlite3 adb command Two ways to access the database *** type: sqlite3 database name.xx The second method: adb shell sqlite3
|
<<: Android Fragment uses full parsing
>>: I've learned a lot. It turns out that Android screen adaptation can be played like this
Unknowingly, 2020 has arrived, and many people ar...
In the mobile Internet era dominated by giants, s...
Editor's note: Himanshu Mehra is an online ma...
Wang Tong · Douyin SEO landing practice class, ha...
Every soldier contributes his own part to the cons...
Author: Cooper In the 1980s, American computer sc...
Let me tell you a story first: Smart little begga...
On December 18, the "Accelerating the Integr...
I ran down the subway station stairs, thinking I ...
There are many ways of online promotion, such as:...
The winning works of the 2023 "China Science...
This year, especially since the second half of th...
I don’t know when it started, but the mobile phon...
The main factors affecting the price of mini prog...
Same with paper towels "Toilet paper" a...