ADB command Set

Source: Internet
Author: User

Record it and maybe use it later.
Getprop returns all system properties for Android.
getevent Print all keyboard and touch events
logcat Output Log
printenv System Environment Variables
am Run start/broadcast/instrument (instrument can run automated test code, others have not tried)
# Android Simulator launch Command mode
execute emulator in android-sdk-windows-1.1 ools to execute emulator
Add the-skin parameter, specify the display mode Hvga-l, you can change to landscape
Emulator-skin hvga-l (480*320, horizontal display)
Emulator-skin hvga-l (320*480, vertical display, simulator preset mode)
Emulator-skin hvga-l (320*240, horizontal display)
Emulator-skin hvga-l (240*320, vertical display)
# Simulate 1GB memory card with Mksdcard instruction
Mksdcard 1024M sacard.img
# Simulator for inserting SD card
Emulator-sdcard sdcard.img
# upload files using adb+push SD memory card
adb push 001.jpg/sdcard (copy files to/sdcard directory)
adb push Pictures/sdcard
adb push Mp3/sdcard
adb shell (Android Simulator startup command mode)
#cd/sdcard (Enter the/sdcard directory)
#ls (View the files in the SD memory card)
# download files from SDcard card using Adb+pull
adb pull/sdcard/001.jpg. (Download the archive under the/sdcard directory)
adb pull/sdcard/pictures. (Download the pictures directory under the SDcard directory)
# Delete the files inside the SD card
adb Shell
#cd/sdcard
#rm 001.jpg (delete the SD memory card file)
#rm-R * (delete all files and directories in SD memory card)
# android Emulator movie playback method
mksdcard 4096M video.img (SD memory card for making an image file)
adb push video.avi/sdcard (copy image files from computer to SD card)
Emulator-sdcard video.img (start simulator and load SD card)
adb install iiivpa.apk (installs Meridian Video Player)
you can then play with the mounted player. MP4, 3GP and. wmv Three file formats
# install APK app
adb install filename.apk (installation filename.apk)
adb install-r filename.apk (save set data, reinstall FILENAME.APK)
adb-s emulator-5554 Install filename.apk (Specify installation apk kit in 5554 Android emulator)
# remove APK app
adb Uninstall Package
adb uninstall-k Package (retains data when removing programs)
This package name is not the file name when installing the APK bundle or the name of the application displayed in the emulator
you can query the package name that you want to remove by going to the/data/data or Data/app directory
adb Shell
ls/data/data or/data/app (query package name)
Exit
adb Uninstall package (removal of the query to the package)
$adb Devices (shows how many emulators are currently executing)
$ADB-S (specify emulator to operate)
adb-s emulator-5554 Install email.apk
$adb Install apkfile (installing APK app)
adb install email.apk
$adb Uninstall Package (remove APK app)
adb Uninstall Com.android.email
$adb Shell (enter Android shell command mode)
$ls
$dmesg (View Android Linux Kernel running information)
ls-show file directory
CD-Enter directory
RM-Delete Files
MV-Moving files
mkdir-Generate directory
rmdir-Delete directory
$adb push (copy files to SD card)
adb push Mp3/sdcard
$adb Pull. (download files from Android system)
adb pull/data/app/com.android.email
$adb Logcat (monitor simulator operation record, with CTRL + C left monitoring mode)
$adb bugreport (generate ADB error report)
$adb Get-state (get the working status of the ADB emulator)
$adb start-server (start adb server)
$adb kill-server (Turn off ADB server)
$adb forward tcp:6100 tcp:7100 (change simulator communication path)
$adb Shell ps-x (shows all the processes executing on the Android emulator)
$adb version (showing adb version)
$adb Help (show adb directive parameters)
5, the search simulator/device instance:
gets a list of instances of the currently running emulator/device and the status of each instance:
ADB devices
6. Check the bug report:
adb bugreport
7. Record the wireless communication log:
Generally speaking, the wireless communication log is very many, at run time not necessary to record, but we can still through the command, set the record:
adb Shell
Logcat-b Radio
8. Get the ID and serial number of the device:
adb get-product
adb Get-serialno
9. Accessing the database SQLite3
adb Shell
Sqlite3
# Emulator Command-line startup parameters
Emulator-timezone Asia/taipei (refers to the timing zone)
Emulator-no-boo-anim (Omit boot-up small robot start screen)
Emulator-scale Auto (adjust emulator window size)
Emulator-scale Factor (factor:0.1-3.0)
Emulator-dpi-device 300 (change the resolution of the emulator, default is 165DPI)
Emulator-skin (change emulator display mode)
Emulator-help-keys (show keyboard quick description)
Emulator-shell (equivalent to adb shell function)
emulator-data data.img (make/data directory use data.img file space)
Emulator-sdcard sdcard.img (make/sdcard directory use sdcard.img document space)
Emulator-cache cache.img (browser staging space)
emulator-wipe-data (causes the emulator to revert to its original settings)
emulator-help (show emulator directive parameters)
Using SQLite from the Shell in Android
Command mode
#ls View
Other:
1. Android supported Linux command is not many, can be found under/system/bin, most of them are Android tools, only a small part of the original Linux commands

2. Some commonly used Android commands (here only summarizes the specific Android, other Linux command data is much)

a) Getprop/watchprops

Getprop lists the properties of the system, preceded by 10 names, followed by values
# Getprop
Getprop
[ro.secure]: [0]
[Ro.allow.mock.location]: [1]
[ro.debuggable]: [1]
[persist.service.adb.enable]: [1]
[Ro.kernel.qemu]: [1]
[Ro.kernel.console]: [ttyS0]
[Ro.kernel.android.checkjni]: [1]
[Ro.kernel.android.qemud]: [TtyS1]
[Ro.kernel.android.ndns]: [1]
[ro.factorytest]: [0]
[Ro.serialno]: []

WATCHPROSP dynamically monitor changes to these properties, such as when I modify the system's language to Chinese, it will print out:
# Watchprops
Watchprops
1269420653 persist.sys.language = ' zh '
1269420653 persist.sys.language = ' CN '

b) Wipe <system|data|all>
wipe means to clear the emulator or the data on the real machine, such as your simulator for a long time, loaded with a lot of software can use this to clear
system indicates that the data under/system is cleared
Data statement clears the/data

c) am
usage:am [subcommand] [options]

start an activity:am start [-d] <INTENT>
-d:enable Debugging

send a broadcast intent:am broadcast <INTENT>

start an INSTRUMENTATION:AM instrument [flags] <COMPONENT>
-r:print Raw Results (otherwise decode Report_key_streamresult)
- e <NAME> <value>: set argument <NAME> to <VALUE>
- p <file>: Write profiling data to <FILE>
-w:wait for instrumentation to finish before returning

Start Profiling:am profile <PROCESS> start <FILE>
Stop Profiling:am profile <PROCESS> stop

<INTENT> specifications include these flags:
[-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>]

am is a tool for managing activity and there are 4 main ways to use it
am Start/stop <INTENT> indicates that starting or stopping a activity,intent parameter can be found in Intent-filter in Androidmanifest.xml
For example, I'm going to open the email activity to write
# AM Start-a android.intent.action.SEND_MULTIPLE
am Start and startactivity method is a function

Transferred from: http://www.miui.com/thread-1754467-1-1.html

ADB command Set

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.