Common Android command lines-ADB and android-adb
Configuration environment:
- Configure the environment on MAC
(1) Start the terminal. You can search for "terminals" in Spotlight"
(2) Go to the HOME directory. Enter the command cd $ HOME in "terminal ".
(3) Update the. bash_profile file. If the file does not exist, enter the command to create: touch. bash_profile
(4) open the. bash_profile file and enter the command: open-e. bash_profile.
(5) configure the ADB environment. Enter your own path:
Export PATH =$ {PATH}:/Users/apple/Library/Android/sdk/platform-tools
Export PATH =$ {PATH}:/Users/apple/Library/Android/sdk/tools
(6) save the file and close. bash_profile.
(7) Update the environment variable. Command: source. bash_profile
(8) check whether the configuration is successful. Command: adb devices.
If the preceding result is displayed, the configuration is successful.
Common ADB commands:
1. Start SDK Manager: android
2. Start DDMS: dams
3. obtain all the simulators currently running: adb devices
4. install the application: adb install-r application .apk
Uninstall application: adb uninstall application package name
5. Obtain the file in the simulator: adb pull <remote> <local>
6. Write a file to the simulator: add push <local> <remote>
7. Enter the shell mode of the simulator: adb shell
8. view Log information in the command line: adb logcat-s label name
9. view the help information: adb help
10. Filter logs under a package only: adb logcat | grep "com. xsp"
Terminal
1. open multiple terminals: command + N
2. open multiple windows: command + T
Adb shell
Grep
Adb bash