简体   繁体   English

构建多个体系结构的框架(arm64,armv7,armv7s)

[英]Build framework for multiple architectures (arm64, armv7, armv7s)

I'm trying to upload to TestFlight a project build for arm64, armv7, and armv7s. 我正在尝试将针对arm64,armv7和armv7s的项目构建上传到TestFlight。 It is using a framework from another project. 它正在使用另一个项目的框架。 But the frameowork appears to be built only for arm64 and not arm64 ( file was built for arm64 which is not the architecture being linked (armv7) ). 但是frameowork看起来只是为arm64构建而不是arm64( file was built for arm64 which is not the architecture being linked (armv7) )。

The question is how do I make the framework containing all architectures? 问题是如何使框架包含所有体系结构? I want to keep the projects separated. 我希望将项目分开。 And I don't care for simulators. 而且我不关心模拟器。 I want to make sure it is built for release. 我想确保它是为发布而构建的。

This is the framework target: 这是框架目标:

在此输入图像描述

EDIT: My project is Cordova based. 编辑:我的项目是基于Cordova。 So it is using a plugin which utilize a pre-built framework. 所以它使用的是一个使用预构建框架的插件。 There are instructions out there for building a fat framework, containing simulators and device, then concatenating it with lipo . 有指令用于构建一个包含模拟器和设备的胖框架,然后将它与lipo连接起来。 What I need is the architecture from the device I don't have as well. 我需要的是我没有的设备架构。 Does that actually mean I need three devices from arm64, armv7, and armv7s to be able to concatenating them altogether? 这是否意味着我需要arm64,armv7和armv7s中的三个设备才能将它们完全连接起来?

Apple has discontinued support for 32-bit in iOS 11. You can neither run 32 bit apps on iOS 11 nor run iOS 11 on 32 bit processors. Apple已停止在iOS 11中支持32位。您既不能在iOS 11上运行32位应用程序,也不能在32位处理器上运行iOS 11。 Thus, you have to set your Deployment Target to an iOS version earlier than iOS 11 for your framework. 因此,您必须将部署目标设置为适用于您的框架的iOS 11之前的iOS版本。

You can try to create an aggregate target and write an script which will support all the platform. 您可以尝试创建聚合目标并编写一个支持所有平台的脚本。 This is sample script from one of my project. 这是我的一个项目的示例脚本。

unset TOOLCHAINS #Xcode 7.3 BUG FIX  http://stackoverflow.com/questions/36184930/xcodebuild-7-3-cant-enable-bitcode

# define output folder environment variable

C_PROJECT_NAME="<<YOUR_FRAMEWORK_NAME>>"

UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

# Step 1. Build Device and Simulator versions
xcodebuild -target <<YOUR_FRAMEWORK_NAME>> ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

xcodebuild -target <<YOUR_FRAMEWORK_NAME>> ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 -arch x86_64 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"

rm -rf ./${C_PROJECT_NAME}.framework
cp -R ${BUILD_DIR}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/${C_PROJECT_NAME}.framework ./

# Step 2. Create universal binary file using lipo

lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${C_PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${C_PROJECT_NAME}.framework/${C_PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${C_PROJECT_NAME}.framework/${C_PROJECT_NAME}"

mv ${UNIVERSAL_OUTPUTFOLDER}/${C_PROJECT_NAME} ./${C_PROJECT_NAME}.framework/${C_PROJECT_NAME}

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

相关问题 arm64 armv7 armv7s架构设置 - arm64 armv7 armv7s Architectures settings 警告:架构的armv7 armv7s&#39;不包含所有必需的架构&#39;arm64&#39; - Warning: architectures 'armv7 armv7s' didn't contain all required architectures 'arm64' 在Armv7,Arv7和arm64中使用Linphone - Use Linphone in Armv7s, Armv7 and arm64 适用于armv7,armv7s和arm64的iOS开源构建 - iOS open source build for armv7 , armv7s ,arm64 armv7,armv7s和arm64的ipa存档版本无法安装到iOS 5.1.1设备 - ipa archive build for armv7, armv7s and arm64 cannot be installed to iOS 5.1.1 devices 检查依赖项...没有要编译的体系结构(ARCHS = i386,VALID_ARCHS = arm64 armv7s armv7) - Check dependencies… No architectures to compile for (ARCHS=i386, VALID_ARCHS=arm64 armv7s armv7) 没有要编译的架构(ARCHS = i386,VALID_ARCHS = arm64 armv7 armv7s) - No architectures to compile for (ARCHS=i386, VALID_ARCHS=arm64 armv7 armv7s) 为armv7,armv7s,arm64,i386和通用构建ffmpeg iOS库 - Building ffmpeg iOS libraries for armv7, armv7s, arm64, i386 and universal 适用于iOS的leptonica 1.69交叉编译(armv7,armv7s和arm64) - leptonica 1.69 crosscompile for iOS (armv7, armv7s and arm64) Worklight 6.0.0.1 iOS Native Library仅适用于ARMv7而不适用于ARMv7和ARM64? - Worklight 6.0.0.1 iOS Native Library only for ARMv7 and not for ARMv7s and ARM64?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM