Skip to content

Commit

Permalink
[Android] ADB with fzf
Browse files Browse the repository at this point in the history
Add alias function
  • Loading branch information
SimonMarquis committed Aug 20, 2023
1 parent 01039dc commit a037edb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ adb devices -l 2> /dev/null `# list devices and ignore daemon messages` |
```
</div>

!!! tip "This can also be used as an alias, for example `adbz`"

```bash title="~/.bashrc"
function adbz() {
adb devices -l 2> /dev/null `# list devices and ignore daemon messages` |
tail -n +2 `# ignore first line` |
head -n -1 `# ignore last line` |
cut -d " " -f1 `# extract device id` |
fzf --header '📱 Select one or more devices' --border --reverse --multi \
--preview-window="right:66%" \
--preview="adb -s {} shell getprop | grep -E 'ro.build.(description|fingerprint|version.(release|sdk))|ro.product.(cpu.abi|device|locale|manufacturer|model|name)'" |
xargs --no-run-if-empty --verbose -I % adb -s % "$@" `# run the command with provided arguments`
}
```

Then simply execute your regular `adb` command with `#!bash adbz install app.apk`

### APK MIME type

`application/vnd.android.package-archive`
Expand Down

0 comments on commit a037edb

Please sign in to comment.