ADB and bat combination

Source: Internet
Author: User

ADB's all-called Android Debug Bridge, is the role of the Debug bridge. With ADB we can debug the Android program via DDMS in Eclipse, and the ADB process will run automatically when we run eclipse.

adb command

1. remount re-mount the system partition to make the system partition writable
ADB remount

2. root for Administrator privileges
ADB root

3. Devices viewing device
ADB devices

4 Install the software, install the specified APK file on the device
ADB install <apk file path >

5. Uninstall Uninstall the software, if you add the-K parameter, to uninstall the software but retain the configuration and cache files.
ADB uninstall-k < software name >

6. Shell enters device or simulator
ADB shell
The command behind the ADB shell comes mainly from: source \system\core\toolbox directory and source \frameworks\base\cmds directory.

7. Forward release port, you can set any port number as the host to the emulator or device request port.
ADB forward tcp:5555 tcp:8000

8. Push sends files from the computer to the device
ADB Push < Local path > < remote path >

9. Pull to download files from the device to the computer
ADB pull < Remote path > < local path >

10, reboot restart the phone
ADB reboot

11. Sqlite3 Access Database SQLite3
Sqlite3

12. Bugreport View bug Report
ADB bugreport

13, Logcat record wireless communication log
Logcat-b Radio

14, get-product get the ID and serial number of the device:
ADB get-product
ADB Get-serialno

Bat Tool

Test.bat file:
@echo off
Set APK_SRC_PATH=C:\USERS\ASUS\DESKTOP\AA

Set sys_apk_dst_path=/system/app/
Set sys_jar_dst_path=/system/framework/
Set sys_lib_dst_path=/system/lib/
Set sys_fonts_dst_path=/system/fonts/

ADB root

ADB remount

for/f "delims="%%i in (' dir/b/a-d/S "%apk_src_path%" ') Do (

Echo%%~nxi
echo-------------xxxxxxxxxx--------------

If%%~xi==.apk (
ADB Shell RM%sys_apk_dst_path%%%~nxi
ADB push%%~fi%sys_apk_dst_path%
) Else if%%~xi==.so (

ADB push%%~fi%sys_lib_dst_path%
) Else if%%~xi==.ttf (

ADB push%%~fi%sys_fonts_dst_path%
) Else if%%~xi==.jar (

ADB push%%~fi%sys_jar_dst_path%
)
)

Pause

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.