首页 > 其他分享 >scrcpy macos 编译安装最新版 1.2.4

scrcpy macos 编译安装最新版 1.2.4

时间:2022-11-23 22:32:25浏览次数:76  
标签:scrcpy macos 1.0 SDL2 libusb install homebrew 最新版


概况:

看官网发布日志,新版加了还少新的特性。 尝试了直接用 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

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_官网

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

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

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

scrcpy macos 编译安装最新版 1.2.4_官网_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

标签:scrcpy,macos,1.0,SDL2,libusb,install,homebrew,最新版
From: https://blog.51cto.com/fangkailove/5881794

相关文章