ios – 使用可可触摸框架构建

ios – 使用可可触摸框架构建,第1张

概述有没有办法如何在 xcode中有一个框架的两个版本,一个用于模拟器的构建,一个用于生产的构建,并根据我构建的内容使用项目中的一个? 我有一个问题,为tvOS应用程序制作一个胖框架(但这也适用于iOS),这需要bitcode所以我认为这样的东西将是一个解决方案? 我将以下脚本用于我的框架项目. 将聚合目标添加到工作区.在构建阶段 – >运行脚本添加以下脚本. #!/bin/shUNIVERSAL 有没有办法如何在 xcode中有一个框架的两个版本,一个用于模拟器的构建,一个用于生产的构建,并根据我构建的内容使用项目中的一个?
我有一个问题,为tvOS应用程序制作一个胖框架(但这也适用于iOS),这需要bitcode所以我认为这样的东西将是一个解决方案?解决方法 我将以下脚本用于我的框架项目.

将聚合目标添加到工作区.在构建阶段 – >运行脚本添加以下脚本.

#!/bin/shUNIVERSAL_OUTPUTFolDER=${BUILD_DIR}/${CONfigURATION}-universal# make sure the output directory existsmkdir -p "${UNIVERSAL_OUTPUTFolDER}"# Step 1. Build Device and Simulator versionsxcodebuild -target "${PROJECT_name}" ONLY_ACTIVE_ARCH=NO -configuration ${CONfigURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean buildxcodebuild -target "${PROJECT_name}" -configuration ${CONfigURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build# Step 2. copy the framework structure (from iphoneos build) to the universal foldercp -R "${BUILD_DIR}/${CONfigURATION}-iphoneos/${PROJECT_name}.framework" "${UNIVERSAL_OUTPUTFolDER}/"# Step 3. copy Swift modules from iphonesimulator build (if it exists) to the copIEd framework directorySIMulATOR_SWIFT_MODulES_DIR="${BUILD_DIR}/${CONfigURATION}-iphonesimulator/${PROJECT_name}.framework/Modules/${PROJECT_name}.swiftmodule/."if [ -d "${SIMulATOR_SWIFT_MODulES_DIR}" ]; thencp -R "${SIMulATOR_SWIFT_MODulES_DIR}" "${UNIVERSAL_OUTPUTFolDER}/${PROJECT_name}.framework/Modules/${PROJECT_name}.swiftmodule"fi# Step 4. Create universal binary file using lipo and place the combined executable in the copIEd framework directorylipo -create -output "${UNIVERSAL_OUTPUTFolDER}/${PROJECT_name}.framework/${PROJECT_name}" "${BUILD_DIR}/${CONfigURATION}-iphonesimulator/${PROJECT_name}.framework/${PROJECT_name}" "${BUILD_DIR}/${CONfigURATION}-iphoneos/${PROJECT_name}.framework/${PROJECT_name}"# Step 5. ConvenIEnce step to copy the framework to the project's directorycp -R "${UNIVERSAL_OUTPUTFolDER}/${PROJECT_name}.framework" "${PROJECT_DIR}"# Step 6. ConvenIEnce step to open the project's directory in Finderopen "${PROJECT_DIR}"
总结

以上是内存溢出为你收集整理的ios – 使用可可触摸框架构建全部内容,希望文章能够帮你解决ios – 使用可可触摸框架构建所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1003419.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存