Commonly used terminal commands in ubuntu
Lsusb query the usb device id by adding 0x ***** (numbers 0 and letters x) to the home directory/. android/adb_usb.ini File)
Adb devices displays all currently running Simulators
Adb reboot restart adb reboot-p Shutdown
Adb install-r application .apk install the application (-r re-install the program to save data;-s is installed in the SD card, rather than the internal storage of the device)
Adb uninstall unzip -k] .apk Delete the package from the device (-k does not delete the data and cache directory generated by the program running)
Adb push xxxx.apk/system/app installation xxxx.apk to the mobile phone/system/app directory
The adb shell enters the shell mode of the simulator.
The adb shell pm clean package name can clear the apk data of a package, which is equivalent to clearing the Data'
Use vi in busybox vi xxxx shell mode
Delete xxxx.apk in rm-rf xxxx. appk shellmode
Adb logcat-c clears all log Cache Information
Adb logcat-d Outputs cached logs to the screen without blocking
Adb logcat-v process | grep 6666 6666 is the process PIID
Adb logcat | grep act = view broadcast and service
Adb logcat | grep-iE "wqtest | qqqq" Print log contains wqtest or qqqq Information
Adb pull mobile phone directory computer directory (executed under the computer directory) Copy mobile phone files to the computer
Ctrl + c terminate a running program
Adb shell ping 192.168.1.128 (mobile Internet) Check if there is a problem with the 192.168.1.128 Server
Ctrl + z pause the running program jobs to view the number of commands currently running in the background
Fg restarts the foreground interrupted task. The bg Command places the interrupted task in the background for execution. (bg % jobnumber)
Find a path-name wq * find the wq * file under path
Adb shell ps | grep systemui search for the process whose name contains systemui in the mobile phone
Adb shell kill *** end the process whose process number is *** on the mobile phone
Ps-aux (| grep ***) linux check the computer process sudo kill-s 9 *** end the computer *** process (-s 9: force and terminate the process as soon as possible)
Xkill select End Program (point where to end that process)
Scp-r xxx public@10.20.31.10:/work1/local file xxx copied to public@10.20.31.10 computer/work1/directory
Scp-r public@10.20.31.10:/work1/wqtest/z507/ALPS-MP-M0.MP1-V2.84_TOP6737M_65_M0/idh. code/customize/out/Z507HZA_TOPODM_SATPAY_v1.1.15/z507hza_topodm_satpay_v1.1.15_e.mcm/work1/
Copy the xxx file from the 10.20.31.10 server to the local/work1/directory (enter the file in the local directory instead of in the Server Directory)
Ctrl + L smb: // data
Adb root obtains administrator privileges
Adb remount re-mount the system partition to make the system partition writable
Adb disable-verity unlock system partition (out/host/linux-x86/bin/directory contains adb)
Log. d ("wqtest", Log. getStackTraceString (new Throwable () print stack information
Display clear on the terminal before the reset is deleted.
Sudo pkill Xorg computer crashes and then logs out and restarts
Du-sh * view the size of the sub-file in the current path directory
View the total file size in the du-sh path
Df-h to view the overall usage
Grep-rn "wqtest"/work1 search for files containing wqtest in work1
Locate * wenqiang * query the file address
Git reset origin/master undo the commit value of the previous commit
Git branch origin/master undo git add and git commit
Reset rollback label checkout rollback directory
Capture mtklog
1) adb shell am broadcast-a com. mediatek. mtklogger. ADB_CMD-e using _name start -- ei using _target 23
2) adb pull/storage/emulated/0/mtklog
Disable mtklog: adb shell am broadcast-a com. mediatek. mtklogger. ADB_CMD-e using _name stop -- ei using _target 23
Adb shell pm-p com. duomi. android to view the installation location on the mobile phone (corresponding apk)
Adb shell pm disable com. lakala. cloudpos. autoactive
Adb shell am start-n app.standard.com/com.standard.app.activity.ConsumeSuccessActivity process name/activity
Start a specified activity (AndroidMainifestPackage Name:Com. standard. app)
{/\ (Wqtest \ | CameraActivity \)} query multiple strings in vi (wqtest or CameraActivity)
Adb shell am start-n com. android. gallery3d/. app. GalleryActivity
Adb shell am kill-all: kill all background processes
Adb shell am broadcast-a *** send *** broadcast
Ctrl + shift + f switch between simplified and traditional Chinese characters
Package: convert a large number of files or directories into a total file.
Tar or tgz: (package: tar cvf xxx.tar xxx) (unpack: tar xvf xxx.tar)
Compression: convert a large file into a small file using some compression algorithms.
Zip :( zip xxx.zip xxx) (unzip xxx.zip) rar :( decompress: unrar x xxxx.rar)
Mkdir wqtest: Create a folder wqtest rm-rf wqtest: Force delete the file wqtest
Cp-r source file (folder) Destination location sudo shutdown + 100 computer shutdown after 100 minutes
Connection server: ssh public@10.20.31.2 password: public10
Adb shell setprop persist. sys. usb. activation yes unlock usb debugging (some projects need to be inserted into the sim to enable debugging and configure)
Adb shell screencap-p | sed's/\ r$ // '> wqtest.png takes a screenshot of the mobile phone screen, ensuring that the current folder is under the directory (the file name wqtest.png does not use adb pull)
Getevent/sendevent adb shell getevent
Getevent is used to obtain some parameters of the current system input device and data of real-time events (Assisted Driver verification); sendevent is used to send input events (simulated events are used for upper-layer application verification ), the tool source code is located in the system/core/toolbox of the Android SDK.
The keycode of each key of the adb shell input keyevent keycode can be found in the KeyEvent. java class. The commonly used keycode is as follows:
HOME: 3 BACK: 4 POWER: 26 MENU: 82
Terminal input: adb shell input keyevent 3 the external device will press the home Key and return to the main menu event
Adb shell pm list packages to obtain which packages are installed in the current system
Adb shell cat/proc/kmsg/prints kernel information, which corresponds to the printk statement in the driver.
Diff [Option] compare the differences (files or directories) between the target files of the source file and the two files)
| Xargs | the MPs queue implements "using the standard output as the standard input" and "using standard input as the command parameter"
* #3646633 # * capture MTKlog
Sudo apt-get update Software List
Sudo apt-get upgrade Update Software
Adb shell setenforce 0 force selinux firewall disabled
In the folder, F3 opens (closes) a file in the same directory.
Gedit ***. txt open with text ***. txt file nautilus open the folder corresponding to the terminal path
Chmod 777-R modify File Permissions
It has been fully compiled, but the module compilation times Error: No/system/build. prop found. perhaps You can't build all. touch out/target/product/tpw8735a_t6/system // build. prop
Touch file Update Time Command
Java-version or which java
Source/work1/code360/Hx6060530/ALPS-MP-M0.MP1-V2.140.3_TOP6737M_65_A_M0/alps/mbldenv. sh
Module compilation before full encoding:
Load command source build/envsetup. sh
Select platform compilation option lunch
Execute make-j8 USDKService
Clear the previously compiled executable file and configuration file make clean
Clear all generated files make distclean
Adb shell dumpsys activity | grep "mFocusedActivity"
Activity ActivityManagerService AMS
Package PackageManagerService PMS Information
Window WindowManagerService WMS Information
Input InputManagerService IMS Information
Power PowerManagerService PMS Information
Batterystats BatterystatsService battery statistics
Battery BatteryService battery Information
Alarm AlarmManagerService alarm message
Dropbox DropboxManagerService debugging
Procstats ProcessStatsService process Statistics
Cpuinfo CpuBinder CPU
Meminfo MemBinder memory adb shell dumpsys meminfo (check the pid Number of the Process) adb shell top | grep pid Number dynamically displays the memory usage of the process
Gfxinfo GraphicsBinder Image
Dbinfo DbBinder Database
SurfaceFlinger Image Correlation
Appops app usage
Permission
Processinfo process service
Batteryproperties battery
Audio view sound information
Netstats view network statistics
Diskstats view free space status
Jobsched
Wi-Fi information
Diskstats disk status
Usagestats user usage
Devicestoragemonitor device information