繁体   English   中英

Xcode 从文件夹或使用通配符添加资源文件

[英]Xcode add resource files from folder or with wildcard

我有一个跨越 2 个平台的项目:一个项目在 linux/ubuntu 上,另一个在 mac/iOS 上。

我想要实现的是将我的 linux 安装程序 package (.deb 文件)嵌入到我的 iOS 应用程序资源中。 It's a long story why I want to do this, but basically my iOS app will be communicating with my linux app on some external hardware and so I want my iOS app to be able to update the app on my linux hardware (I already know how进行通信和更新步骤)。

我还将使用 CI(在我的例子中是 Jenkins)设置我的项目来自动构建我的项目。 So I want to be able to automate the process of 1) creating the linux.deb package installer, 2) move the.deb package installer over to the iOS project, 3) build the iOS project and have the.deb package stored in my iOS 建成项目。

我遇到的问题是 my.deb 文件名会在每个构建版本中更改。 例如,我的 deb package 在一次构建中可能被命名为“MyLinuxApp_x86_64_v1.0.1234.deb”,但在下一个构建中将被命名为“MyLinuxApp_x86_64_v1.0.1235.deb”。

所以我的问题是,有没有办法将我的 XCode 项目设置为:

  1. 基于通配符字符串捆绑所有文件。 例如“MyLinuxApp_x86_64*.deb”
  2. 或将所有文件捆绑在一个文件夹中。 例如“MyLinuxAppPackageFolder”,在该文件夹中,我会在构建我的 XCode 项目之前复制 my.deb 文件

需要明确的是,我知道每次文件名更改时如何“手动”添加此文件,但我需要一种方法来自动化它。

感谢您的任何帮助,您可以提供。

是的,您可以使用通配符,但您应该确保您的源目录中只有一个文件匹配。

将此添加为构建步骤:

RESOURCE_PATH="$SRCROOT/where/ever/.../MyLinuxApp_x86_64_*.deb"

BUILD_APP_DIR=${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}
cp $RESOURCE_PATH "$BUILD_APP_DIR/BundledLinuxApp_x86_64.deb"

暂无
暂无

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

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