program story

Xcode 5 및 iOS 7 : 아키텍처 및 유효한 아키텍처

inputbox 2020. 10. 5. 07:55
반응형

Xcode 5 및 iOS 7 : 아키텍처 및 유효한 아키텍처


Xcode 5에서 새 프로젝트를 시작하고 있습니다. iOS SDK 7배포 대상을 사용하여 응용 프로그램을 개발하고 싶습니다 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(64 비트 없음)으로 변경했습니다 . 나는 컴파일하고 실행하지만 방금 일어난 일을 정말로 이해하지 못합니다. Xcode 프로젝트 빌드 설정의 설정

의 차이점은 무엇입니까 ? 64 비트를 제외하도록 설정 하면 64 비트 iPhone 또는 iOS 시뮬레이터에서 앱을 실행하면 어떻게 되나요? 새로운 64 비트 아키텍처의 큰 혼란을 설명 할 수 있습니까?ArchitecturesValid architectures
Architectures

여기에 이미지 설명 입력


빌드 설정의 아키텍처를 표준 아키텍처 (armv7, armv7s)로 설정합니다.

여기에 이미지 설명 입력

iPhone 5S는 A7 64 비트 프로세서로 구동됩니다. 에서 사과 문서

Xcode는 32 비트 및 64 비트 바이너리를 모두 포함하여 앱을 빌드 할 수 있습니다. 이 결합 된 바이너리는 iOS 7 이상의 최소 배포 대상이 필요합니다.

참고 : Xcode의 향후 버전에서는 iOS 6 이상에서 32 비트 런타임을 지원하고 iOS 7에서 64 비트 런타임을 지원하는 단일 앱을 만들 수 있습니다.

내가 이해 한 문서에서

  • Xcode는 단일 앱에 대해 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은 아키텍처 섹션을 크게 변경했습니다. 답변 은 후속 조치가 될 것입니다. 이것을 확인하십시오


64 비트를 설정하면 결과 바이너리가 "Fat"바이너리가됩니다. 여기에는 얇은 fat 헤더와 함께 번들로 제공되는 3 개의 Mach-O 이미지가 모두 포함됩니다. otool 또는 jtool을 사용하여 확인할 수 있습니다. 다음과 같이 AVFoundation Framework와 같이 iOS 7.0 SDK의 일부로 포함 된 일부 팻 바이너리를 확인할 수 있습니다.

% 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.


My understanding from Apple Docs.

  • What is Architectures (ARCHS) into Xcode build-settings?
    • Specifies architecture/s to which the binary is TARGETED. When specified more that one architecture, the generated binary may contain object code for each of the specified architecture.
  • What is Valid Architectures (VALID_ARCHS) into Xcode build-settings?

    • Specifies architecture/s for which the binary may be BUILT.
    • During build process, this list is intersected with ARCHS and the resulting list specifies the architectures the binary can run on.
  • Example :- One iOS project has following build-settings into Xcode.

    • ARCHS = armv7 armv7s
    • VALID_ARCHS = armv7 armv7s arm64
    • In this case, binary will be built for armv7 armv7s arm64 architectures. But the same binary will run on ONLY ARCHS = armv7 armv7s.

You do not need to limit your compiler to only armv7 and armv7s by removing arm64 setting from supported architectures. You just need to set Deployment target setting to 5.1.1

Important note: you cannot set Deployment target to 5.1.1 in Build Settings section because it is drop-down only with fixed values. But you can easily set it to 5.1.1 in General section of application settings by just typing the value in text field.


Simple fix:

Targets -> Build Settings -> Build Options -> Enable Bitcode -> No

Works on device with iOS 9.3.3


None of the answers worked and then I was forgetting to set minimum deployment target which can be found in Project -> General -> Deployment Info -> Deployment Target -> 8.0

예

참고URL : https://stackoverflow.com/questions/18913906/xcode-5-and-ios-7-architecture-and-valid-architectures

반응형