APP such as pods and 360 Mobile Phone Manager can obtain the name of the Android device, which is displayed on the interface, for example:
How can we get the device name? The answer is as follows:
Enter "ADB shell" in the command line"
After entering the shell, enter "cat/system/build. Prop"
In fact, the device information is mainly stored in the "/system/build. Prop" file and can be viewed through the "cat" command.
The following is a detailed description of the ADB command.
ADB introduces ADB, which is called the android debug bridge debugging bridge and serves as a bridge between Android phones and PCs. ADB can be used to manage and operate simulators and devices, such as installing software, upgrading the system, and running shell commands. Device management Note: Android phones and simulators are collectively referred to as "devices"
ADB devices // display the device connected to the computer
ADB get-serialno // obtain the device ID and serial number serialnumber
------------------ Restart ----------------------------------------------
ADB reboot // restart the device
ADB reboot bootloader // restart to bootloader, that is, the brush Mode
ADB reboot recovery // restart to recovery, that is, the recovery mode.
------------------ Send command to device --------------------------------------
adb [-d|-e|-s <serialNumber>] <command>
-D sends a command to the USB-connected device-e sends the command to the simulator device-S <serialnumber> sends the command to the specified device
ADB Problems
ADB kill-server // terminate ADB service process ADB start-server // restart ADB service process
ADB root // restart the ADB service with the root permission
ADB wait-for-device // re-run the command in the adb cli before the simulator/device is connected.
Obtain device hardware information
ADB shell CAT/sys/class/NET/wlan0/address // obtain the MAC address ADB shell CAT/proc/cpuinfo // obtain the CPU serial number
Manage device apps
Aapt D badging <apkfile> // obtain the packagename and classname of the APK.
------------------ Install ----------------------------------------------
ADB install <apkfile> // install APK
ADB install-r <apkfile> // retain data and cache files, and reinstall APK,
ADB install-S <apkfile> // install APK to the SD card
------------------ Uninstall ----------------------------------------------
ADB uninstall <package> // uninstall the app
ADB uninstall-k <package> // uninstall the app but keep the data and cached files
------------------ Start the app -------------------------------------------
ADB shell am start-n <package_name>/. <activity_class_name> // start the application
------------------ View memory usage ----------------------------------------
ADB shell top // view the CPU and memory usage of the device
ADB shell top-M 6 // view the app that occupies the first 6 of the memory
ADB shell top-N 1 // refresh the memory information once, and then return
ADB shell procrank // query the memory usage of each process
ADB Shell kill [pid] // kill a process
ADB shell PS // view the process list
ADB shell PS-X [pid] // view the status of a specified process
ADB Shell Service list // view background services information ADB shell CAT/proc/meminfo // view current memory usage ADB shell CAT/proc/iomem // view Io memory partition File Operations
// In Android, sdcard indicates internal storage. The device names of TF cards in different systems may be different. View ADB shell ls MNT to view the names of all storage devices.
ADB remount // Remount the system partition to a read/write Partition
ADB push <local> <remote> // copy a file from a local device
ADB pull <remote> <local> // copy the file from the device to the local device.
ADB shell ls // list the files and folders in the directory, which is equivalent to the Dir command in DOS
ADB shell CD <folder> // enter the folder, equivalent to the CD command in DOS
ADB shell rename path/oldfilename path/newfilename // rename the file
ADB shell RM/system/avi.apk // delete system/avi.apk
ADB shell Rm-r <folder> // delete a folder and all its files
ADB shell MV path/file newpath/file // move the file
ADB shell chmod 777/system/fonts/droidsansfallback. TTF // set File Permissions
ADB shell mkdir path/foldelname // create a folder
ADB shell cat <File> // view the File Content