Android command collection

Source: Internet
Author: User
Tags dmesg

CD/system/bin

Ls

After running the above script, all android commands will appear:
Dumpcrash am dumpstate monkey itr PM input SVC ssltest fillup dhcpcd linker
Debugadh hostapd_cli logwrapper Ping sh hciattach logcat sdptool servicemanager
Export-daemon debug_tool dvz flash_image hcid htclogkernel mountd installd qemud
Toolbox radiooptions hostapd ID ifconfig iftop IOCTL kill insmod ln log mkdir ls lsmod
Mkdosfs Mount MV netstat running y printenv PS reboot rmdir RM renice rmmod route schedtop
Setconsole setprop sendevent SMD sleep sync stop start top umount vmstat wipe watchprops cat
Chmod CMP date DF dd getevent getprop dmesg HD netcfg dumpsys playmp3 Service
Sdutil rild dalvikvm dexopt surfaceflinger app_process mediaserver system_server

Android is a Linux operating system, so most of them are Linux commands, such as mkdir, ls, netstat, mount, and PS. We will not introduce them here,
This section mainly introduces several Android features.
Getprop returns all system attributes of 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)


# Running Mode of the command column in the android Module
Emulator in android-sdk-windows-1.1/tools connector line
With the-skin numeric value, the HVGA-L mode can be specified as the forward direction.
Emulator-skin HVGA-L (480*320, horizontal indication)
Emulator-skin HVGA-L (320*480, vertical indication, mode preset)
Emulator-skin HVGA-L (320*240, horizontal indication)
Emulator-skin HVGA-L (240*320, vertical indication)

# Use the mksdcard command to create a 1 GB memory card
Mksdcard 1024 M sacard. img

# Insert the module into the SD card
Emulator-sdcard. img

# Use ADB + push to upload the hosts file to the SD memory card
ADB push 001.jpg/sdcard (under/sdcard)
ADB push pictures/sdcard)
ADB push MP3/sdcard)
ADB Shell)
# Cd/sdcard (inbound/sdcard category)
# Ls)

# Use ADB + pull to download the upload case from the SD record
ADB pull/sdcard/001.jpg)
ADB pull/sdcard/pictures. (pictures under the sdcard category)

# Remove the example in the SD card
ADB Shell
# CED/sdcard
# Rm 001.jpg)
# Rm-R)

# How to play a video in the android modulo player
Mksdcard 4096 m video. img)
ADB push video. AVI/sdcard (from a computer to an SD card)
Emulator-sdcard video. img)
Video player demo, EX: meridian Video Player (iiivpa.apk)
Http://sites.google.com/site/eternalsandbox/Home/meridian-video-player
ADB install iiivpa.apk (anw.meridian Video Player)
You can use the preceding three formats: player).mp4, 3GP, And. wmv.

# Security APK Application
ADB install filename.apk ( filename.apk)
ADB install-r filename.apk)
ADB-s emulator-5554 install filename.apk)

# Remove an APK Application
ADB uninstall package
ADB uninstall-K package (retain information when removing the Program)
This package name is not the runtime name of the security APK package or indicates the application name used in the module.
You can first go to/data or data/APP to check the package name deleted by the consumer.
ADB Shell
Ls/data or/data/APP)
Exit
ADB uninstall package (remove the package found by the supervisor)

# ADB system division and termination tools
$ ADB Devices)
$ ADB-S <serialnumber> <command>)
ADB-s emulator-5554 install email.apk
$ ADB install apkfile (Security APK Application Kit)
ADB install email.apk
$ ADB uninstall package (remove the APK application suite)
ADB uninstall com. Android. Email
$ ADB shell (in the Command column mode of the Android system)
$ Ls
$ Dmesg (view the kernel operation information of Android Linux)
Ls-Example: Project Description
CD-import object
Rm-Division case
MV-mobile migration case
Mkdir-Product Overview
Rmdir-exclude object Division

$ ADB push <file/dir> (zookeeper transfer to the SD card)
ADB push MP3/sdcard
$ ADB pull <file/dir>)
ADB pull/data/APP/COM. Android. Email
$ ADB logcat)
$ ADB bugreport)
$ ADB get-state)
$ ADB start-server (Dynamic ADB server)
$ ADB kill-server (disable the ADB server)
$ ADB forward TCP: 6100 TCP: 7100)
$ ADB shell PS-x)
$ ADB version (ADB Version)
$ ADB help (displays the number of ADB commands)

5. Search for simulator/device instances:

Obtain the list of running Simulators/devices and the status of each instance:

ADB Devices

6. view the bug report:

ADB bugreport

7. Record wireless communication logs:

In general, there are a lot of wireless communication logs and there is no need to record them during operation, but we can still set the record through the command:

ADB Shell

Logcat-B radio

8. Get the device ID and serial number:

ADB get-Product

ADB get-serialno

9. Access the database sqlite3

ADB Shell

Sqlite3


# Emulator command Column
Emulator-timezone Asia/Taipei (specified time zone)
Emulator-no-boo-anim)
Emulator-scale auto (memory size of the worker window)
Emulator-scale factor (factor: 0.1-3.0)
Emulator-DPI-device 300 (change the resolution of the modulo splitter, default is 165 DPI)
Emulator-skin <skinid>)
Emulator-help-keys)
Emulator-shell (equivalent to the ADB shell function)
Emulator-data. img)
Emulator-sdcard. IMG (enable/sdcard category to use the quota space of sdcard. IMG)
Emulator-Cache cache. img)
Emulator-wipe-Data)
Emulator-help (displays the number of emulator commands)

Using SQLite from shell in Android

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.