运行 1 个自定义 shell 脚本中的 1 个冻结 [英] Running 1 of 1 custom shell scripts freeze

查看:14
本文介绍了运行 1 个自定义 shell 脚本中的 1 个冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个框架,在尝试使用自定义 shell 脚本代码编译用于生产的框架时,它在这一步冻结.

I'm building a framework, while trying to compile the framework for production with custom shell script code, it freeze's on this step.

这是自定义的shell脚本代码:

This is the custom shell script code:

# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

# Step 1. Build Device and Simulator versions
xcodebuild -target SomeSDK ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
xcodebuild -target SomeSDK -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"

# Step 2. Create universal binary file using lipo
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"

# Last touch. copy the header files. Just for convenience
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/include" "${UNIVERSAL_OUTPUTFOLDER}/"

这是一个冻结的图像:

我该如何解决这个问题?为什么会这样?

How can I fix that? why this is happening?

推荐答案

我找到了我所要求的答案,只是我做错了.

I found the answer to what I asked for, I just did it wrong.

首先让我说,网络上所有展示如何创建 iOS 静态库 的教程都缺少一些东西,至少我所看到的并不完美,这就是第一个原因我遇到这个问题的地方.

Let me start by saying that all the tutorials on the web that shows how to create an iOS Static Library, are missing something and not perfect at least what I saw, that's the reason in the first place I had this issue.

那些是我过去做得对的:

Those are the ones I used to do it right:

这就是我的问题的答案:

And this is the answer to my problem:

我没有创建一个新的 Aggregate Target 并在那里插入 Custom Shell Script 代码,而是将 Custom Shell Script 代码添加到以自己为目标,这是错误的.这就是为什么编译永远不会完成并且总是冻结的原因.

Instead of creating a new Aggregate Target and insert the Custom Shell Script code there, I just added the Custom Shell Script code into the target it self, which was wrong. That's why compilation never completed and always freeze.

只需点击Targets部分下的+按钮,选择Other,然后选择Aggregate.在这个目标中,您必须添加您的 Custom Shell Script 代码,它会完美运行.

Just click on the + button under the Targets section, choose Other and then Aggregate. In this target you have to go and add your Custom Shell Script code and it will works flawless.

感谢您的帮助.

享受吧!

这篇关于运行 1 个自定义 shell 脚本中的 1 个冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆