简体   繁体   English

Xcode - 动态添加第 3 方框架

[英]Xcode - Dynamically Adding 3rd party framework

I have seen a few topics regarding this subject, but as I am not very familiar with xcode and the various ways to include external dependencies, my question is specific to the ZoomSDK.我已经看过一些关于这个主题的主题,但由于我对 xcode 以及包含外部依赖项的各种方法不是很熟悉,所以我的问题是针对 ZoomSDK 的。

Zoom provides 2 versions of the SDK, one for simulator and one for device only. Zoom 提供 2 个版本的 SDK,一个用于模拟器,一个用于设备。

In the integration guide they have you集成指南中,他们有你

  • manually add the framework to the "Embeded Binaries" and "Linked Frameworks and Libraries"手动将框架添加到“嵌入式二进制文件”和“链接框架和库”
  • add the bundle to "Build Phases > Copy Bundle Resources"将包添加到“构建阶段>复制包资源”

In Xcode I do not see separate options for "Embeded Binaries" and "Linked Frameworks".在 Xcode 中,我没有看到“嵌入式二进制文件”和“链接框架”的单独选项。 I do have one section for "Frameworks, Libraries, and Embeded Content".我确实有一个“框架、库和嵌入内容”部分。

I added the framework here, followed the rest of the install directions and zoom is working appropriately.我在这里添加了框架,按照安装方向的 rest 和缩放工作正常。

I have placed the sdk files in /lib and am able to swap the files for the correct version when building/running the app.我已将 sdk 文件放在/lib中,并且能够在构建/运行应用程序时将文件交换为正确的版本。 (Zoom - Simulator, Zoom - Device Only) (缩放 - 模拟器,缩放 - 仅限设备)

Rather than manually moving the files before building, is there a way to store the files in /lib/zoom-device and /lib/zoom-sim and have xcode choose the appropriate folder when building for device vs sim?与其在构建之前手动移动文件,有没有办法将文件存储在/lib/zoom-device/lib/zoom-sim中,并让 xcode 在为设备与 sim 构建时选择适当的文件夹?

This is a react-native project and eventually i would like to create/add a pod.这是一个 react-native 项目,最终我想创建/添加一个 pod。 (currently /lib/ is in.gitignore and any other devs need to download the sdk and create the folder manually) (当前/lib/在.gitignore 中,其他开发者需要下载 sdk 并手动创建文件夹)

I managed to create a pre-action under edit scheme->build我设法在edit scheme->build下创建了一个pre-action

case ${ARCHS} in
    *arm*) 
        cp -R ${PROJECT_DIR}/lib/MobileRTC/* ${PROJECT_DIR}/lib
        ;;
    *i386*|*x86_64*) 
        cp -R ${PROJECT_DIR}/lib/MobileRTC-Simulator/* ${PROJECT_DIR}/lib
        ;;
esac

There are probably better ways to do this but it is working.可能有更好的方法可以做到这一点,但它正在发挥作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM