#TCP 経由で画面キャプチャ
端末とPCをTCP経由で接続します
画面キャプチャできます
不要になったら切断します
./connect.sh XXX.XXX.XXX.XXX 5555
./capture.sh
TCPによる接続は非常に便利で
adb logcat
等も使えます
| #!/bin/bash | |
| adb shell /system/bin/screencap -p /sdcard/screenshot-android-image.png | |
| sleep 1s | |
| adb pull /sdcard/screenshot-android-image.png | |
| adb shell rm /sdcard/screenshot-android-image.png |
| #!/bin/bash | |
| # 引数にIPアドレスがない場合終了 | |
| port=5555 | |
| if [ $# -ne 1 ]; then | |
| if [ $# -ne 2 ]; then | |
| echo "./capture.sh {IP address} [port]" 1>&2 | |
| exit 1 | |
| fi | |
| port=$2 | |
| fi | |
| ipaddress=$1 | |
| adb tcpip $port | |
| adb connect $ipaddress:$port | |
| adb devices |
| #!/bin/bash | |
| adb disconnect $ipaddress:$port |
| #!/bin/bash | |
| START=$(date +%s) | |
| # ... | |
| END=$(date +%s) | |
| SS=$(expr ${END} - ${START}) | |
| echo "${SS}" |