82

iOS SDK 7Xcode 5 で新しいプロジェクトを開始しています。配置ターゲットを使用してアプリケーションを開発したいと考えていますiOS 5.0。Xcode で新しいプロジェクトを作成し、展開ターゲットを 5.0 に変更しようとするとすぐに、次のメッセージが表示されます。

Applications including an arm64 slice are not compatible with versions of iOS
prior to 6.0
Adjust your Architectures build setting to not include arm64 in order to deploy
to releases prior to iOS 6.0.

そのため、アーキテクチャをStandard(no 64bit) に変更しました。コンパイルして実行しますが、何が起こったのかよくわかりません。Xcode プロジェクトのビルド設定のとの設定

の違いは何ですか? 64 ビットを除外するように設定した場合、64 ビットの iPhone または iOS シミュレーターでアプリを実行するとどうなりますか? 新しい 64 ビット アーキテクチャの大きな混乱について説明できますか?ArchitecturesValid architectures
Architectures

ここに画像の説明を入力

4

6 に答える 6

123

ビルド設定のアーキテクチャを 標準アーキテクチャ (armv7、armv7s) に設定します。

ここに画像の説明を入力

iPhone 5S は A7 64 ビット プロセッサを搭載しています。アップルのドキュメントから

Xcode は、32 ビットと 64 ビットの両方のバイナリを含めてアプリをビルドできます。この結合されたバイナリには、iOS 7 以降の最小展開ターゲットが必要です。

注: Xcode の将来のバージョンでは、iOS 6 以降で 32 ビット ランタイムをサポートし、iOS 7 で 64 ビット ランタイムをサポートする単一のアプリを作成できます。

ドキュメントから私が理解したのは

  • Xcode は 1 つのアプリに対して両方の 64 ビット 32 ビット バイナリを作成できますが、デプロイ ターゲットは iOS7 である必要があります。彼らは、将来はiOS 6.0になると言っています
  • 32 ビット バイナリは、iPhone 5S (64 ビット プロセッサ) で正常に動作します。

更新 (Xcode 5.0.1)
Xcode 5.0.1 では、iOS 5.1.1 以降の 64 ビット バイナリを作成するためのサポートが追加されました。

Xcode 5.0.1 では、32 ビットと 64 ビットの両方のバイナリを含めてアプリをビルドできます。この結合されたバイナリには、iOS 5.1.1 以降の最小展開ターゲットが必要です。64 ビット バイナリは、iOS 7.0.3 以降を実行する 64 ビット デバイスでのみ実行されます。

更新 (Xcode 5.1)
Xcode 5.1 では、アーキテクチャ セクションが大幅に変更されました。この回答はフォローアップになります。 これをチェックして

于 2013-09-20T10:08:30.553 に答える
9

Apple Docsからの私の理解。

  • Xcode ビルド設定へのアーキテクチャ(ARCHS) とは何ですか?
    • バイナリがTARGETEDであるアーキテクチャを指定します。複数のアーキテクチャが指定されている場合、生成されたバイナリには、指定された各アーキテクチャのオブジェクト コードが含まれる場合があります。
  • Xcode ビルド設定への有効なアーキテクチャ(VALID_ARCHS)とは何ですか?

    • バイナリがBUILTであるアーキテクチャを指定します。
    • ビルド プロセス中に、このリストは ARCHS と交差し、結果のリストはバイナリを実行できるアーキテクチャを指定します。
  • 例:- 1 つの iOS プロジェクトには、Xcode への次のビルド設定があります。

    • ARCHS = armv7 armv7s
    • VALID_ARCHS = armv7 armv7s arm64
    • この場合、バイナリは armv7 armv7s arm64 アーキテクチャ用にビルドされます。ただし、同じバイナリは ARCHS = armv7 armv7s でのみ実行されます。
于 2013-12-10T09:53:07.370 に答える
6

When you set 64-bit the resulting binary is a "Fat" binary, which contains all three Mach-O images bundled with a thin fat header. You can see that using otool or jtool. You can check out some fat binaries included as part of the iOS 7.0 SDK, for example the AVFoundation Framework, like so:

% cd  /Developer/Platforms/iPhoneOS.platform/DeviceSupport/7.0\ \(11A465\)/Symbols/System/Library/Frameworks/AVFoundation.framework/

%otool -V -f AVFoundation                                                                     9:36
Fat headers
fat_magic FAT_MAGIC
nfat_arch 3
architecture arm64     # The 64-bit version (A7)
    cputype CPU_TYPE_ARM64
    cpusubtype CPU_SUBTYPE_ARM64_ALL
    capabilities 0x0
    offset 16384
    size 2329888
    align 2^14 (16384)
architecture armv7        # A5X - packaged after the arm64version
    cputype CPU_TYPE_ARM
    cpusubtype CPU_SUBTYPE_ARM_V7
    capabilities 0x0
    offset 2359296
    size 2046336
    align 2^14 (16384)
architecture armv7s       # A6 - packaged after the armv7 version
    cputype CPU_TYPE_ARM
    cpusubtype CPU_SUBTYPE_ARM_V7S
    capabilities 0x0
    offset 4407296
    size 2046176
    align 2^14 (16384)

As for the binary itself, it uses the ARM64 bit instruction set, which is (mostly compatible with 32-bit, but) a totally different instruction set. This is especially important for graphics program (using NEON instructions and registers). Likewise, the CPU has more registers, which makes quite an impact on program speed. There's an interesting discussion in http://blogs.barrons.com/techtraderdaily/2013/09/19/apple-the-64-bit-question/?mod=yahoobarrons on whether or not this makes a difference; benchmarking tests have so far clearly indicated that it does.

Using otool -tV will dump the assembly (if you have XCode 5 and later), and then you can see the instruction set differences for yourself. Most (but not all) developers will remain agnostic to the changes, as for the most part they do not directly affect Obj-C (CG* APIs notwithstanding), and have to do more with low level pointer handling. The compiler will work its magic and optimizations.

于 2013-09-21T13:42:06.013 に答える
6

サポートされているアーキテクチャからarm64設定を削除して、コンパイラをarmv7およびarmv7sのみに制限する必要はありません。展開ターゲット設定を 5.1.1に設定するだけです。

重要な注意: Build Settingsセクションで Deployment target を 5.1.1 に設定することはできません。これは、固定値のみのドロップダウンであるためです。ただし、テキスト フィールドに値を入力するだけで、アプリケーション設定の [全般] セクションで簡単に 5.1.1 に設定できます。

于 2014-09-15T18:06:35.513 に答える
5

簡単な修正:

ターゲット -> ビルド設定 -> ビルド オプション -> ビットコードを有効にする -> いいえ

iOS 9.3.3 搭載のデバイスで動作

于 2016-08-12T15:43:35.767 に答える
4

答えはどれもうまくいきませんでした。その後、プロジェクト- >一般- >展開情報- >展開ターゲット- > 8.0で見つけることができる最小展開ターゲットを設定するのを忘れていました

例

于 2016-05-30T07:57:13.917 に答える