专栏首页along的开发之旅iOS CPU架构 arm64/armv7s/armv7/armv7k/i386/x86_64

iOS CPU架构 arm64/armv7s/armv7/armv7k/i386/x86_64

转自:https://docs.elementscompiler.com/Platforms/Cocoa/CpuArchitectures/

CPU Architectures

When building for the Cocoa platform, Elements allows you to choose to build for different CPU Architectures, depending on the target devices and operating system versions you wish to support. Elements allows the creation of so-called "Universal Binaries", or "Fat Binaries", that can include executable code for more than one platform (for example 32-bit and 64-bit).

You can pick one main set of architectures for your application, which might include one or more options depending on the SDK abd version. On iOS, tvOS and watchOS, in addition to picking architectures for the device deployment, you can also select separate architectures for running in the Simulator.

macOS

On macOS, one architecture is supported as of now: 64-bit Intel, officially called x86_64 and sometimes also simply referred to as x64. Future versions of Elements and macOS might add support for additional platforms (for example if Apple releases ARM-based Macs).

Elements does not support the 32-bit i386 architecture for macOS, because the "Modern Objective-C Runtime", introduced with Mac OS X 10.5 Leopard, is not supported on 32-bit. The Modern Objective-C Runtime is a prerequisite for ARC, as well as many other runtime features Cocoa developers take for granted these days. Also, 32-bit Mac applications are largely irrelevant today, deprecated as of macOS 10.14 and totally unsupported as of macOS 10.15.

iOS and iPadOS

On iOS and iPadOS, Elements supports three architectures for device deployment:

  • arm64 is the current 64-bit ARM CPU architecture, as used since the iPhone 5S and later (6, 6S, SE and 7), the iPad Air, Air 2 and Pro, with the A7 and later chips.
  • armv7s (a.k.a. Swift, not to be confused with the language of the same name), being used in Apple's A6 and A6X chips on iPhone 5, iPhone 5C and iPad 4.
  • armv7, an older variation of the 32-bit ARM CPU, as used in the A5 and earlier.

Very old iOS devices shipped before 2009 had armv6 CPUs, which are no longer supported by current iOS SDKs, nor by Elements.

In Project Settings, you can select to build your projects for one or more architectures. You can either choose architectures explicitly, or you can select Default, in which case no architectures will be hardcoded into the project settings, and the project will automatically be built against a default set of architectures (currently arm64-only). This is the most forward-thinking setting, since it will automatically include new architectures when you rebuild your project against newer SDKs.

  • arm64 is only available in iOS 7.0 or later.
  • armv7s is only available in iOS 6.0 or later.

Choose carefully when excluding architectures. An application build with armv7 will run on all current iOS devices, even those that support newer architectures (it will run as 32-bit on iPhone 5S and later). But on the other hand, an app build without armv7 will not run on older devices such as the iPhone 4/4S or the original iPad mini.

In addition to the device architecture, Project Settings will also let you choose architectures for the Simulators, where appropriate (i.e. on iOS).

  • x64_64 (i.e. 64-bit Intel) is optionally available starting with iOS 7.0.
  • i386 (i.e. 32-bit Intel) is the only option on iOS 6.1 and below.

Just as with the device architectures, a special Match Device option is provided for the Simulator Architectures. Selecting this option will once again not hardcode any architectures in the project; instead Elements will automatically pick the appropriate Simulator architectures, based on which device architectures you are building for. If your application includes armv7 and/or armv7s, it will include i386 in the Simulator architectures; if your are building for arm64 on the device, it will build for x86_64 on Simulator.

Just as on the device, Simulator builds can be Universal Binaries and include two (and potentially more, in the future) architectures. If built with both architectures, you can test your application in both 32-bit and 64-bit versions of the Simulator, without needing to rebuild.

tvOS

On tvOS, Elements supports one architectures each for device deployment, and one for the Simulator:

  • arm64 is the current 64-bit ARM CPU architecture and used on Apple TV 4
  • x64_64 (i.e. 64-bit Intel) is used in the Simulator

watchOS

On watchOS, Elements supports two architectures each for device deployment and for the Simulator

  • arm64_32 is a variant of arm64 with 32-bit pointer sizes, used on Apple Watch Series 4 and later.
  • armv7k is a 32-bit variant of regular armv7, and used from the orginal Apple Watch up to Series 3.
  • x86_64 (i.e. 64-bit Intel) is used in the Simulator
  • i386 (i.e. 32-bit Intel) is used in the Simulator

UIKit for Mac

On UIKit for Mac, the same architecture(s) are supported as on macOS, currently only x86_64.

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • iOS 合并虚拟机和真机的静态库-a

    iOS 合并虚拟机和真机的静态库.a,就要静态库.a同时支持armv7、armv7s、arm64、i386、x86_64:

    展菲
  • iOS 静态库.a冲突解决

    从图中可以知道我去了哪里(前面面试总结文章有人好奇)。 回到正题,以前我是有过专门做SDK的经验,所以像这种sdk报错遇到的不少,如图有价值也很明显的问题点在...

    清墨
  • iOS端TXLiteAVSDK与其它三方库冲突报错问题

    iOS 端在集成腾讯云视频服务客户端音视频SDK时,与开发者自己工程中的第三方库冲突,导致编译报错。

    腾讯视频云-Zachary
  • Xcode11打包失敗IPA processing failed

    是因为项目中使用的SDK支持i386,x86_86這個架构,可能是iOS13不支持模拟器架构了,所以必须强制去除。

    用户6094182
  • 代码管理| 手把手教你封装自己的静态库SDK

    这里重点说下,怎样饮用Bundle中的图片资源。这里使用的是简写:@"JWJFramework.bundle/open"其中JWJFramework.bundl...

    進无尽
  • Xcode常用的配置

    Header Search Paths与User Header Search Paths

    剑行者
  • 如何使用 Python 开发 iOS 程序?

    本文介绍了如何用 Python 开发 iOS 程序,其实最主要解决的就是下面三件事情:一是在 iOS App 中安装 Python 解释器,二是搭建 Pytho...

    serena
  • (一)音视频三方库交叉编译

    为什么在讲解音视频之前我需要先讲讲交叉编译呢?因为音视频开发将会涉及到很多三方库,特别是基于C语言的,在iOS和安卓开发中是没办法直接编译这些库,比如常见的MP...

    sweet说好的幸福
  • Xrepo:一个现代化的跨平台 C/C++ 包管理器

    它基于 xmake 提供的运行时,但却是一个完整独立的包管理程序,相比 vcpkg/homebrew 此类包管理器,xrepo 能够同时提供更多平台和架构的 C...

    ruki

扫码关注云+社区

领取腾讯云代金券