Skip to content

Display and control your Android device

Add -s auto-completion for bash

Anima C131bfbadef9658
diff --git a/app/data/bash-completion/scrcpy b/app/data/bash-completion/scrcpy
index 3e75cbb0..0d3a2559 100644
--- a/app/data/bash-completion/scrcpy
+++ b/app/data/bash-completion/scrcpy
@@ -93,6 +93,11 @@ _scrcpy() {
COMPREPLY=($(compgen -W 'verbose debug info warn error' -- "$cur"))
return
;;
+ -s|--serial)
+ # Use 'adb devices' to list serial numbers
+ COMPREPLY=($(compgen -W "$("${ADB:-adb}" devices | awk '$2 == "device" {print $1}')" -- ${cur}))
+ return
+ ;;
-b|--bitrate \
|--codec-options \
|--crop \
@@ -103,7 +108,6 @@ _scrcpy() {
|-m|--max-size \
|-p|--port \
|--push-target \
- |-s|--serial \
|--tunnel-host \
|--tunnel-port \
|--v4l2-buffer \