0
点赞
收藏
分享

微信扫一扫

scrcpy macos 编译安装最新版 1.2.4


概况:

看官网发布日志,新版加了还少新的特性。 尝试了直接用 brew install ,upgrade 等方法,都没有装成。 查了一下原因homebrew 目前只提供 1.18的版本。 要装新的目前只能自己下代码编译了

参考官网:scrcpy/BUILD.md at master · Genymobile/scrcpy · GitHub

Mac OS

1. 安装必要的库和编译工具

# runtime dependencies brew install sdl2 ffmpeg libusb

# client build dependencies brew install pkg-config meson

2.下载源码

git clone https://github.com/Genymobile/scrcpy cd scrcpy

3.编译和安装

下载prebuilt server

  • ​​scrcpy-server-v1.24​​​ SHA-256: ​​ae74a81ea79c0dc7250e586627c278c0a9a8c5de46c9fb5c38c167fb1a36f056​

Download the prebuilt server somewhere, and specify its path during the Meson configuration:


meson x --buildtype=release --strip -Db_lto=true \ -Dprebuilt_server=[改为上面下载保存的文件] ninja -Cx # DO NOT RUN AS ROOT


测试运行

Run without installing:


./run x [options]


安装

Install

After a successful build, you can install scrcpy on the system:


sudo ninja -Cx install # without sudo on Windows


scrcpy 就能用了。

卸载方法:

Uninstall


sudo ninja -Cx uninstall # without sudo on Windows


安装过程 ninja -Cx # DO NOT RUN AS ROOT    

报错及解决办法

scrcpy macos 编译安装最新版 1.2.4_c语言

 这里很明显是,头文件引用时路径错了,SDL2   在导入路径里有了,在头文件引用时也包含了,重复了,导致引入文件实际查找 xxxxxxx/SD2/SD2/xxxxxxx.h 了,将错就错,按上面路径

在 /opt/homebrew/include/SDL2 下再建个 SDL2目录 并文件都复制到 SDL2子目录里:

/opt/homebrew/include/SDL2/SDL2/*.h 就都能找到了。

scrcpy macos 编译安装最新版 1.2.4_github_02

这个错误也是和上面同理,把 /opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 多建一级子目录 /opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0/libusb-1.0

举报

相关推荐

0 条评论