1. Ubuntu Configuration Environment anroid variable:
Execute sudo gedit/etc/profile at the terminal to open the text editor, and at the end append #set android Environment
2. Running 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, reboot
3. Add Device ID identification to the current Android debugging environment
Add in/home/loginname/.android file, device ID for Android terminal
4. Update SDK
"Android Update SDK" Update SDK
5. Common commands:
"ADB help" getting assistance
"Adb-s XXX" login ID for XXX's cell phone, used in more than 2 cell phones or simulators
"ADB get-serialno" get device serial number
The "ADB root" has access to root, which is useful for some handsets, and most of the listed handsets have turned this feature off. Access to root permissions can also be done through third-party tools such as pea clips.
"adb kill-server" kills ADB's server process.
ADB Start-server launches ADB's server process.
"ADB devices" view the Android terminals that connect.
"Android List" shows all Android terminals
"Ddms" Start Ddms
"ADB remount" reloads the hard drive.
"ADB reboot" restarts the terminal.
"ADB install/path/appname" installation application
"ADB uninstall Com.android.helloworld" Uninstall HelloWorld, the application of the system belt can not be unloaded.
"ADB push/sourcepath/filename/destinationpath/filename" copies a file from the PC to the terminal
"ADB pull/sourcepath/filename/destinationpath/filename" copies a file from the terminal to the PC side
"ADB logcat-v time-s TAGNAME" displays custom TAGNAME and displays the time
"ADB PPP" starts PPP via USB
"ADB monkey-p/path/appname-v 100" enforces testing 100 times for programs
The ADB shell launches the shell command terminal on the PC side.
The above command requires the PC-side root permissions, when the command fails, you can try to switch working directory to the SDK under the tools, such as: sudo-s,adb kill-server,adb Start-server,exit can re-enter.
6. Shell command, you can use the BusyBox toolset:
' am start-n {package name (Package)}/{package name}. {Active activity name} "starts an event of an app, configures reference Androidmanifest.xml, such as an alarm clock:
# AM Start-n Com.android.alarmclock/com.android.alarmclock.alarmclock
' Am broadcast-a android.intent.action.ActionName ' sends broadcast messages
"SetProp Key Value" Sets the property value bit value of the key
"Getprop Key" gets the property value of the key
"GetEvent" gets all events
"Watchprops" monitor changes in property values
Stop SERVER forcibly stops a service
Start SERVER starts a service
"IOCTL" control device
"Dumpsys activity" displays active stack information
"Top" displays information such as resource consumption for an instant process
"Free" displays current process memory usage
"PS" Displays the identity information of the process itself
"Rm/path/filename" Deletes a file from the terminal
"MkDir" creates a new directory or file
grep to find specific content
"LS" Displays the files in the current directory
"CD" Toggle current directory
"chmod" Change file properties
"CP" Copy files
"DD" Copy files
"MV" mobile directory file, or renamed
"Cat" View file contents
Kill kills the process.
"ipconfig" View change network interface address and parameters
"Ping" detects network status
"Netstat" View network status
Telnet log on to a remote host
"Sqlite3/path/databasename.db" opens a database. You can then use database operations commands such as Select,insert,delete
"Tcpdump-p-nnn-vvv-s 0-w/path/name.pcap port and TCP" network debugging Grab Bag
"Gst-launch playbin Uri=file:///system/media/audio/bootaudio.mp3" GST multimedia framework, playing audio files
"Alsa_amixer" audio debugging commands, you can switch channels, adjust the volume, switch equipment. The parameters of different chip manufacturers are set differently.
"Alsa_aplay-d Androidplayback_speaker_normal/cache/music/dial/0.wav" plays the PCM stream through the ALSA.
"Alsa_arecord" realizes recording through ALSA
"Am start-n com.android.music/com.android.music.mediaplaybackactivity-d/sdcard/bootaudio.mp3" starts the Android process playback mp3
"Stack--symbols-dir=./out/target/product/name/symbols ramdump" View Call stack
Exit out of the shell
"Lsof" shows files opened by the specified process
Through the ADB shell, Cd/system/bin,ls can list most of the commands available.
7. The venderid of some Android phones is as follows, the method to view Venderid is: Lsusb
# 0x0525 NXP 6715/6719 Chip
# 0x04cc NXP U8500 Chip
# 0X18D1 Broadcom2157 Dual SIM Chip
# 0x2314 GHT Moke
# 0x04e8 Anycall gt-i5508
# 0x22b8 Moto XT701 XT300
# 0x0bb4 HTC A8180