https://github.com/balsikandar/adb-commands
This Repo leverages all the things we can do with ADB commands.
https://github.com/balsikandar/adb-commands
adb adb-commands android broadcasting intent
Last synced: 5 months ago
JSON representation
This Repo leverages all the things we can do with ADB commands.
- Host: GitHub
- URL: https://github.com/balsikandar/adb-commands
- Owner: balsikandar
- License: apache-2.0
- Created: 2019-09-30T17:35:24.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-06-01T18:45:28.000Z (almost 4 years ago)
- Last Synced: 2023-02-27T04:02:42.915Z (about 2 years ago)
- Topics: adb, adb-commands, android, broadcasting, intent
- Language: Java
- Homepage:
- Size: 31.3 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Most useful ADB commands
This Repo contains a list of most useful everyday ADB commands.### ADB Pull and Push files from Device to PC
First check all the connected devices using
```
adb devices
```If multiple devices are connected check below image then use command with device id
Run schell script with Device Id
```
adb -s RZ8M60W2LCH shell
```Since we're connected to device now we can browse code using commands like **ls, pwd, cd**
```
$ ls$ cd sdcard/
```Finally once you find the file you want to pull just use pull command
```
e.g: adb pull /sdcard/screenshots/screen.png
```### ADB am (Activity Manager)
Activity Manager *(am)* can be used to stuffs like broadcasting intent to start an activity or making calls etc...#### Making a call
```
adb shell am start -a android.intent.action.CALL -d tel:88******97
```#### Open Google Map
```
adb shell am start -a android.intent.action.VIEW -d 'geo:28.65381,77.22897'
```#### Broadcasting an Intent
```
adb shell am broadcast android.net.conn.CONNECTIVITY_CHANGE
```### ADB Screen Record
Record video while testing or debugging your app.#### Record screen video on device
```
adb shell screenrecord /path-on-device/recording.mp4
```#### We can set *time-limit* for minimum recording time
```
adb shell screenrecord /sdcard/recording.mp4 --time-limit 20
```#### To check all the available options
```
adb shell screenrecord --help
```### ADB pm (Package Manager)
Package Manager can be used to do things like clear app data, uninstall an app, restart an app all these things at package level#### ADB command to clear app data
```
adb shell pm clear packageName
```#### ADB command to install an apk
```
adb install path/your_app.apk
```#### ADB command to update a release apk
```
adb install -r path/release.apk
```#### ADB command to uninstall an apk
```
adb uninstall packageName
```### License
```
Copyright (C) 2016 Bal Sikandar
Copyright (C) 2011 Android Open Source ProjectLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.