ADB usage Summary

Source: Internet
Author: User

Article transferred from:

Http://www.cnblogs.com/622698abc/archive/2013/06/11/3132306.html

 

Run ADB shell AM broadcast on the command line to send broadcast notifications.

 

Parameters following ADB shell AM broadcast include:

[-A <action>]
[-D ]
[-T <mime_type>]
[-C <Category> [-C <Category>]...]
[-E | -- es <extra_key> <extra_string_value>...]
[-- EZ <extra_key> <extra_boolean_value>...]
[-E | -- EI <extra_key> <extra_int_value>...]
[-N <component>]
[-F <flags>] [<URI>]

 

For example:

The value of the key value of the command type to be sent to (the same as the value later)

ADB shell AM broadcast-A Android. Intent. Action. Edit-- EsTest_string"This is test string" -- EI test_int 100 -- EZ test_boolean true

 

Description: The Key type is blue, and the value type is red. The values are string type, int type, and boolean type.

Certificate ------------------------------------------------------------------------------------------------------------------------------------

Part 1:

1. Configure the environment anroid variable in Ubuntu:

Run sudo gedit/etc/profile on the terminal to open the text editor and append # Set Android Environment

2. To run eclipse, you also need to configure Java environment variables.

# Set Java environment

Java_home =/home/loginname/JDK directory name

Jre_home =/home/loginname/JDK directory name/JRE

Export Path = $ java_home/bin: $ jre_home/bin: $ path

Export classpath = $ java_home/lib: $ jre_home/lib: $ classpath

Export Path =/home/loginname/android-sdk-linux_86/tools: $ path

After saving, restart

3. Add the device ID to the current Android debugging environment

Add the device ID of the android terminal to the/home/loginname/. Android file.

4. Update the SDK

[Android update SDK] updates the SDK.

5. Common commands:

[ADB help] get help

[ADB get-serialno] Get the device serial number

[ADB root] obtaining root permissions is useful for some mobile phones. Most listed mobile phones have disabled this function. You can also obtain the root permission through a third-party tool such as the bean clip.

[ADB kill-server] kills the server process of ADB.

[ADB start-server] starts the server process of ADB.

[ADB devices] view the android terminal that establishes the connection.

[Android list] displays all android Terminals

[Ddms] Start ddms

ADB remount: Reload the hard disk.

[ADB reboot] restarts the terminal.

[ADB install/path/appname] install the application

[ADB uninstall com. Android. helloworld] uninstall helloworld. Applications in the system cannot be uninstalled.

[ADB push/sourcepath/filename/destinationpath/filename] copy a file from the PC end to the terminal

[ADB pull/sourcepath/filename/destinationpath/filename] copy a file from the terminal to the PC end

[ADB logcat-V Time-s tagname] displays the custom tagname and time

[Adb ppp] Start PPP through USB

[ADB monkey-P/path/appname-V 100] forcibly tests the program for 100 times.

ADB shell: Start the shell command terminal on the PC.

The preceding Command requires the root permission on the PC. If the command fails, you can try to switch the working directory to the SDK tools, for example, sudo. /ADB kill-server, sudo. /ADB start-server.

6. Use the following command in shell:

[Am start-N {package name}/{package name}. {activity name}] Start the activity of an app. For configuration reference, see androidmanifest. XML, for example, alarm:
# Am start-N com. Android. alarmclock/COM. Android. alarmclock. alarmclock

[AM broadcast-A Android. Intent. Action. actionname] sends a broadcast message.

Setprop key value: Set the property value of the key.

[Getprop key] Get the property value of this key

[Getevent] get all events

[Watchprops] monitors changes in the property value.

[Stop server] forcibly stops a service

[Start server] starts a service.

[IOCTL] Control Device

Dumpsys activity: displays activity stack information.

[Top] displays the resource usage and other information of instantaneous processes.

[Free] displays the memory usage of the current process.

[PS] displays the identity information of a process.

Rm/path/filename: delete an object from the terminal.

[Mkdir] create a directory or file

[Grep] search for specific content

[Ls] displays files in the current directory

[Cd] switch the current directory

[Chmod] change file attributes

[Cp] copy an object

[DD] copy an object

[MV] Move or rename a directory file

[Cat] View File Content

[Kill] kills the process

[Ipconfig] view and change the network interface address and Parameters

[Ping] checks the network status

[Netstat] view the network status

Telnet

[Sqlite3/path/databasename. dB] Open a database. Then you can use database operation commands such as select, insert, and delete.

[Tcpdump-p-Nnn-vvv-S 0-W/path/name. pcap port 80 and TCP] network debugging packet capture

[GST-launch playbin uri = file: // system/Media/Audio/bootaudioaudio] GST Multimedia Framework for playing audio files

[Alsa_amixer] Audio debugging command. You can switch audio channels, adjust the volume, and switch devices. Different chip manufacturers have different parameter settings.

[Alsa_aplay-D androidplayback_speaker_normal/Cache/music/dial/0.wav] Play the PCM code stream through ALSA.

[Alsa_arecord] recording through ALSA

[Am start-N com. Android. Music/COM. Android. Music. mediaplaybackactivity-D/sdcard/bootaudiolistener] Start the android process to play MP3

[Stack -- symbols-Dir =./out/target/product/name/Symbols ramdump] view the call stack

[Exit] exit Shell

Using ADB shell, CD/system/bin, ls can list most of the available commands.

7. venderid of Some Android phones

#0x0525 NXP Chip

#0x18d1 broadcom2457 dual-card chip

#0x2314 ght Moke

#0x04e8 anycall GT-I5508

#0x22b8 Moto xt701 xt300

#0x0bb4 HTC a8180

 

Part 2:

ADB (Android debug Bridge) is a common tool for Android users. With this tool, we can develop very well. adb.exe is under the android SDK tools directory you have installed,

ADB usage:

ADB [-d |-E |-S <serialnumber>] <command>

When you issue a command, the system enables the android client. Client

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.