scrcpy 2.7を使いPCのゲームパッドでAndroidのゲームを遊ぶ

Android 端末の画面,音声転送や操作も出来る scrcpy の v2.7 がリリースされました.
今回ゲームパッドに対応したようなので試してみました.
PC に接続されたゲームパッドでAndroid が操作できるようになります.

過去の scrcpy の記事

Linux 架橋への導入はこちらに.

いくつかの環境ではパッケージで最新版が導入できそうですが,今回試す Debian sid amd64 環境では 1.25-1+b1 とちょっと前のバージョンなので source から build します.

依存関係のパッケージを導入
$ sudo apt install ffmpeg libsdl2-2.0-0 adb wget \
                   gcc git pkg-config meson ninja-build libsdl2-dev \
                   libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev \
                   libswresample-dev libusb-1.0-0 libusb-1.0-0-dev
source clone & build & install
$ git clone https://github.com/Genymobile/scrcpy
$ cd scrcpy
$ ./install_release.sh
確認
$ which scrcpy
/usr/local/bin/scrcpy

$ scrcpy --version
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>

Dependencies (compiled / linked):
 - SDL: 2.30.7 / 2.30.7
 - libavcodec: 61.3.100 / 61.3.100
 - libavformat: 61.1.100 / 61.1.100
 - libavutil: 59.8.100 / 59.8.100
 - libavdevice: 61.1.100 / 61.1.100
 - libusb: - / 1.0.27

scrcpy 2.7 が導入できました.

Android が adb コマンドで見えるのを確認
$ adb devices
List of devices attached
ZT322L25CF      device

利用したい Android が adb コマンドで見えるのを確認して,scrcpy を -G オプションをつけて実行します.

Note

Android端末が見えない場合以下のページを参考に.
Android端末をudev roureに登録,udev rule の反映,Android 端末での USB debug の有効化を行います.

$ scrcpy -G

scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  ZT322L25CF                      device  moto_g24
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 135.1 MB/s (71200 bytes in 0.001s)
[server] INFO: Device: [motorola] motorola moto g24 (Android 14)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.2.2-1
INFO: Trilinear filtering enabled
INFO: Texture: 720x1608
[server] WARN: Could not get initial audio timestamp

この状態でAndroid のゲームパッド対応ゲームを起動して,PC に接続されたゲームパッド(今回は XBox360 コントローラー)で操作できるのを確認します.

Android のゲームパッド対応ゲームは以下のページを参考に「The Ramp」というスケボーを使ってランプで遊ぶゲームを入れて試してみました.

scrcpy 2.7 game

10分ほど試しただけですが,違和感なく遊べそうです.

PC環境
$ scrcpy -v
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>

Dependencies (compiled / linked):
 - SDL: 2.30.7 / 2.30.7
 - libavcodec: 61.3.100 / 61.3.100
 - libavformat: 61.1.100 / 61.1.100
 - libavutil: 59.8.100 / 59.8.100
 - libavdevice: 61.1.100 / 61.1.100
 - libusb: - / 1.0.27
$ lsb_release -dr
Description:    Debian GNU/Linux trixie/sid
Release:        n/a
$ arch
x86_64
Android環境
$ adb shell dumpsys package com.nextcloud.client | grep versionName=
    versionName=3.29.2
$ adb shell getprop ro.build.version.release
14
$ adb shell getprop ro.build.version.sdk
34
$ adb shell getprop ro.build.id
UTA34.82-73
$ adb shell getprop ro.product.model
moto g24

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)