• 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

    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    

    报错及解决办法

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

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

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

    这个错误也是和上面同理,把 /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

  • 相关阅读:
    葡萄串目标检测YoloV8——从Pytorch模型训练到C++部署
    6-5 头插法创建单链表(C) 分数 10
    web远程访问Windows桌面(二)
    MVC三层架构
    【JSP】Page指令和九大内置对象
    什么是IOS签名 180.188.22.X
    书籍数组中的最长连续序列(4)0716
    PostgresSQL - 生成uuid
    DALL·E 3:OpenAI的革命性图像生成模型与ChatGPT的融合
    js正则表达式
  • 原文地址:https://blog.csdn.net/fangkailove/article/details/126353679