Xcode 6 → Xcode 7 변경 시 문제가 되었던 것들

Jay Kim
4 min readOct 8, 2015

--

정확히 말하자면 회사에서 기존 프로젝트의 Base SDK를 iOS9으로 변경하면서 문제가 발생했던 부분들에 대해서 간단히 기술해보고자 한다.

Bitcode
애플에서 iOS9에서 앱의 바이너리 사이즈를 줄이고자 발표한 App Thining 기술의 일부라고 생각하면 된다.
Bitcode는 앱을 바이너리 형태가 아닌 컴파일된 코드와 심볼의 중간적인 형태를 iTunes Connect 를 통해 등록하고, 유저가 다운로드하는 시점에 해당 유저에 적합한 바이너리를 생성하는 방식을 통해 앱의 사이즈를 줄이는 기술이다.
우선 iOS9의 경우 기본적으로 bitcode 설정이 On 되어있기 때문에 Cocoapods 라이브러리나 3rd party 라이브러리 사용시에 문제가 발생하는 것 같다.

Bitcode 설정

해결 방법은 간단하다. 프로젝트 설정에서 Enable Bitcode 값을 No로 바꿔주기만 하면 된다.

ATS(Apple Transport Security)

App Transport Security (ATS) enforces best practices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.

If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn’t follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app’s Info.plist file.

‘What’s New in iOS’ 문서를 보면 위와 같이 ATS에 대해서 설명하고 있는데, iOS9 앱의 기본적인 통신은 HTTPS를 사용한 도메인에서만 허용하고 나머지는 block 시키도록 권유하고 있다.

기존 프로젝트에는 이러한 설정이 없었기 때문에, Base SDK가 iOS9으로 설정되어 있는 경우 앱 내에서의 네트웍(API 요청 등)에 연결할 때 HTTPS 도메인이 아닌 경우 모두 실패한다.
뭐 서버에서 HTTPS를 사용하도록 바꾸는 게 최선이겠지만 앱에서 설정을 변경하면 이 문제를 해결할 수 있다.

NSAppTransportSecurity 설정

프로젝트의 info.plist 파일에 NSAppTransportSecurity, NSAllowsArbitraryLoads 라는 항목을 추가하고 NSAllowsArbitraryLoads 값을 YES로 설정하면 된다.

--

--

Jay Kim

iOS를 사랑하는 Software Engineer, 반복 설명하는 것이 점점 귀찮아져서 글을 씁니다 ^^;;;;