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

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

问题描述

我正在构建一个框架,同时尝试使用自定义外壳脚本代码编译该框架以进行生产,但此步骤冻结了.

这是自定义外壳脚本代码:

# 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}/"

这是冻结的图像:

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

解决方案

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

首先,让我说网络上所有显示如何创建iOS Static Library的教程都缺少了某些内容,并且至少不完善我所看到的内容,这就是我首先遇到此问题的原因. /p>

这些是我过去正确做的:

这是我的问题的答案:

我没有创建新的Aggregate Target并在其中插入Custom Shell Script代码,而是只是将Custom Shell Script代码添加到它自己的目标中,这是错误的.这就是为什么编译从未完成并且总是冻结的原因.

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

感谢您的帮助.

享受!

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

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}/"

This is an image where it freezes:

How can I fix that? why this is happening?

解决方案

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

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:

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.

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.

Thanks for the help.

Enjoy!

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

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