카테고리 보관물: iOS

애플서버에서 권한허용 문제로 빌드 실패하는 경우

Xcode 8로 업데이트후 애플 서버에 빌드를 제출하면 잠시후 아래와 같은 메시지로 실패했다고 메일이 오는 경우가 있다. 애플 빌드서버에서 실패하는거라 실제로는 Xcode 8 이 아니라 iOS 10을 지원하는 경우 발생한다고 보는게 맞겠다.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSAppleMusicUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMotionUsageDescription key with a string value explaining to the user how the app uses this data.

이는 카메라나 달력등 개인정보 관련된 권한을 사용할때만 Info.plist에 설정하면 되는 코드인데 사용하지 않는데도 애플 빌드서버에서 이런 오류를 발생하는 경우가 있다.

확인해보니 애플서버에서는 빌드할때 개인정보 관련코드가 외부 라이브러리에 있더라도 이걸 체크해서 무조건 위와 같이 오류를 발생한다.

나는 PermissionScope 라는 라이브러리를 사용하는데 이거는 앱 사용자에게 현재 권한을 보여주고 쉽게 권한을 요청하기에 좋은데 라이브러리 특성상 모든 개인정보 권한 코드를 가지고 있다. 라이브러리 사용할때 특정 개인정보는 사용하지 않으면 사용자가 볼일이 없는데도 라이브러리에 코드가 있다는 이유로 애플 빌드서버에서는 이런 오류를 발생시킨다.

이 문제를 고치려면 이와 같은 라이브러리를 사용하지 않거나 위에 언급된 키들에 대해 모두 문자열을 추가하면된다. 그런데 라이브러리에서 내부적으로 사용하지 않는 코드가 들어있을수도 있는데 이걸 다 어떻게 체크하나 ㅜㅜ 애드몹 같은 경우도 달력이나 몇개의 개인정보에 접근하는 코드가 있는데 이건 개발자가 적용할때 안쓴다고 하면 안쓰는건데…. 그래서 그냥 속편하게 모든 키를 다 추가하면 된다. 어차피 사용자가 안볼 문구이니까

게시글의 아마존, iTunes 링크들을 통해 구매를 하시면 제휴(Affiliate) 프로그램에 의해 저에게 일정 금액이 적립될 수 있습니다. ^_____^

Xcode 8 에서 쓸모없는 로그 출력안하게 하기

Xcode 8을 설치하고 시뮬레이터에서 앱을 실행하면 이전과 달리 엄청난 로그들을 만나게 됩니다. 대략 아래와 같은 로그들이죠…

2016-09-20 18:43:53.720846 daangna[49804:209191] [] nw_endpoint_flow_attach_protocols [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] Attached flow protocol
2016-09-20 18:43:53.720996 daangna[49804:209191] [] nw_endpoint_resolver_receive_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] received child report:[6.1 31.13.68.12:443 in_progress socket-flow (satisfied)]
2016-09-20 18:43:53.721119 daangna[49804:209191] [] nw_connection_endpoint_report [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] reported event flow:start_connect
2016-09-20 18:43:53.725114 daangna[49804:209191] [] nw_socket_handle_socket_event Event mask: 0x800
2016-09-20 18:43:53.725334 daangna[49804:209191] [] nw_socket_handle_socket_event Socket received CONNECTED event
2016-09-20 18:43:53.725523 daangna[49804:209191] [] nw_socket_setup_notsent_lowat Set TCP_NOTSENT_LOWAT(16384)
2016-09-20 18:43:53.725712 daangna[49804:209191] [] nw_endpoint_flow_protocol_connected [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] Output protocol connected
2016-09-20 18:43:53.726224 daangna[49804:209191] [] nw_endpoint_flow_connected_path_change [6.1 31.13.68.12:443 ready socket-flow (satisfied)]
2016-09-20 18:43:53.726454 daangna[49804:209191] [] nw_endpoint_flow_connected_path_change [6.1 31.13.68.12:443 ready socket-flow (satisfied)] Connected path is satisfied
2016-09-20 18:43:53.726645 daangna[49804:209191] [] nw_endpoint_resolver_receive_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] received child report:[6.1 31.13.68.12:443 ready socket-flow (satisfied)]
2016-09-20 18:43:53.726839 daangna[49804:209191] [] nw_connection_endpoint_report [6.1 31.13.68.12:443 ready socket-flow (satisfied)] reported event flow:finish_connect
2016-09-20 18:43:53.727092 daangna[49804:209191] [] nw_connection_endpoint_report [6 graph.facebook.com:443 ready resolver (satisfied)] reported event flow:finish_connect
2016-09-20 18:43:53.727326 daangna[49804:209191] [] nw_endpoint_resolver_receive_report [6 graph.facebook.com:443 ready resolver (satisfied)] received child report:[6.1 31.13.68.12:443 ready socket-flow (satisfied)]
2016-09-20 18:43:53.727563 daangna[49804:209191] [] nw_connection_endpoint_report [6.1 31.13.68.12:443 ready socket-flow (satisfied)] reported event flow:changed_viability
2016-09-20 18:43:53.727758 daangna[49804:209191] [] nw_connection_endpoint_report [6 graph.facebook.com:443 ready resolver (satisfied)] reported event flow:changed_viability
2016-09-20 18:43:53.728074 daangna[49804:209175] [] __tcp_connection_start_block_invoke 6 sending event TCP_CONNECTION_EVENT_CONNECTED in response to state ready and error (null)
2016-09-20 18:43:53.728255 daangna[49804:209175] [] tcp_connection_event_notify 6 event: TCP_CONNECTION_EVENT_CONNECTED, reason: nw_connection event, should deliver: true
2016-09-20 18:43:53.728673 daangna[49804:209175] [] nw_endpoint_start_tls_while_connected [6.1 31.13.68.12:443 ready socket-flow (satisfied)]
2016-09-20 18:43:53.728852 daangna[49804:209175] [] nw_endpoint_start_tls_while_connected [6.1 31.13.68.12:443 ready socket-flow (satisfied)] Using CoreTLS
2016-09-20 18:43:53.729044 daangna[49804:209175] [] nw_endpoint_start_tls_while_connected [6.1 31.13.68.12:443 ready socket-flow (satisfied)] Set custom TLS client queue
2016-09-20 18:43:53.729243 daangna[49804:209175] [] nw_endpoint_start_tls_while_connected [6.1 31.13.68.12:443 ready socket-flow (satisfied)] Set custom TLS prepare handler
2016-09-20 18:43:53.729432 daangna[49804:209175] [] nw_endpoint_start_tls_while_connected [6.1 31.13.68.12:443 ready socket-flow (satisfied)] Set custom TLS message handler
2016-09-20 18:43:53.729621 daangna[49804:209175] [] nw_endpoint_start_tls_while_connected [6.1 31.13.68.12:443 ready socket-flow (satisfied)] Attached TLS protocol to connected flow
2016-09-20 18:43:53.729784 daangna[49804:209175] [] nw_endpoint_resolver_receive_report [6 graph.facebook.com:443 ready resolver (satisfied)] received child report:[6.1 31.13.68.12:443 in_progress socket-flow (satisfied)]
2016-09-20 18:43:53.730001 daangna[49804:209175] [] nw_connection_endpoint_report [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] reported event flow:start_secondary_connect
2016-09-20 18:43:53.730186 daangna[49804:209175] [] nw_connection_endpoint_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] reported event flow:start_secondary_connect
2016-09-20 18:43:53.730400 daangna[49804:209175] [] nw_endpoint_resolver_receive_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] received child report:[6.1 31.13.68.12:443 in_progress socket-flow (satisfied)]
2016-09-20 18:43:53.730580 daangna[49804:209175] [] nw_connection_endpoint_report [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] reported event flow:start_connect
2016-09-20 18:43:53.730777 daangna[49804:209175] [] nw_connection_endpoint_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] reported event flow:start_connect
2016-09-20 18:43:53.730938 daangna[49804:209175] [] nw_endpoint_flow_protocol_connected [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] Transport protocol connected
2016-09-20 18:43:53.731079 daangna[49804:209175] [] nw_endpoint_resolver_receive_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] received child report:[6.1 31.13.68.12:443 in_progress socket-flow (satisfied)]
2016-09-20 18:43:53.731277 daangna[49804:209175] [] nw_connection_endpoint_report [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] reported event flow:finish_transport
2016-09-20 18:43:53.731424 daangna[49804:209175] [] nw_connection_endpoint_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] reported event flow:finish_transport
2016-09-20 18:43:53.746985 daangna[49804:209191] [] nw_endpoint_flow_protocol_connected [6.1 31.13.68.12:443 in_progress socket-flow (satisfied)] Output protocol connected
2016-09-20 18:43:53.747630 daangna[49804:209191] [] nw_endpoint_flow_connected_path_change [6.1 31.13.68.12:443 ready socket-flow (satisfied)]
2016-09-20 18:43:53.747850 daangna[49804:209191] [] nw_endpoint_flow_connected_path_change [6.1 31.13.68.12:443 ready socket-flow (satisfied)] Connected path is satisfied
2016-09-20 18:43:53.748068 daangna[49804:209191] [] nw_endpoint_resolver_receive_report [6 graph.facebook.com:443 in_progress resolver (satisfied)] received child report:[6.1 31.13.68.12:443 ready socket-flow (satisfied)]
2016-09-20 18:43:53.748310 daangna[49804:209191] [] nw_connection_endpoint_report [6.1 31.13.68.12:443 ready socket-flow (satisfied)] reported event flow:finish_connect
2016-09-20 18:43:53.748607 daangna[49804:209191] [] nw_connection_endpoint_report [6 graph.facebook.com:443 ready resolver (satisfied)] reported event flow:finish_connect
2016-09-20 18:43:53.748830 daangna[49804:209175] [] __tcp_connection_start_block_invoke 6 sending event TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE in response to state ready and error (null)
2016-09-20 18:43:53.749050 daangna[49804:209175] [] tcp_connection_event_notify 6 event: TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE, reason: nw_connection event, should deliver: true
2016-09-20 18:43:53.749295 daangna[49804:209175] [] tcp_connection_get_statistics DNS: 3ms/4ms since start, TCP: 10ms/17ms since start, TLS: 18ms/34ms since start
2016-09-20 18:44:07.686676 daangna[49804:209118] subsystem: com.apple.UIKit, category: Touch, enable_level: 0, persist_level: 0, default_ttl: 1, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-20 18:44:07.687387 daangna[49804:209118] subsystem: com.apple.UIKit, category: Gesture, enable_level: 0, persist_level: 0, default_ttl: 1, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-20 18:44:07.688917 daangna[49804:209118] subsystem: com.apple.UIKit, category: GestureExclusion, enable_level: 0, persist_level: 0, default_ttl: 1, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-20 18:44:58.968517 daangna[49804:209882] [] nw_socket_handle_socket_event Event mask: 0x2
2016-09-20 18:44:58.968960 daangna[49804:209883] [] tcp_connection_cancel 6
2016-09-20 18:44:58.969395 daangna[49804:209882] [] nw_socket_handle_socket_event Socket received READ_CLOSE event
2016-09-20 18:44:58.969753 daangna[49804:209882] [] nw_endpoint_handler_cancel [6 graph.facebook.com:443 ready resolver (satisfied)]
2016-09-20 18:44:58.970003 daangna[49804:209882] [] nw_endpoint_handler_cancel [6.1 31.13.68.12:443 ready socket-flow (satisfied)]
2016-09-20 18:44:58.970305 daangna[49804:209882] [] nw_endpoint_flow_protocol_disconnected [6.1 31.13.68.12:443 cancelled socket-flow (null)] Output protocol disconnected
2016-09-20 18:44:58.970517 daangna[49804:209882] [] nw_resolver_cancel_on_queue 0x618000103210
2016-09-20 18:44:58.970791 daangna[49804:209882] [] -[NWConcrete_tcp_connection dealloc] 6

이 로그들을 없애려면 “Edit Scheme” 에서 “Run” > “Arguments” > “Environment Variables” 에 다음과 같은 값을 추가해야합니다.

Name 에는 OS_ACTIVITY_MODE 를 추가하고 Value 에는 disable 을 입력후 왼쪽 체크박스를 체크한 상태로 둡니다.

Xcode 8 log fix

Xcode 8 log fix

이 현상은 애플이 의도적으로 넣은건지 아닌지 모르겠지만 꽤나 귀찮습니다.

참고자료

게시글의 아마존, iTunes 링크들을 통해 구매를 하시면 제휴(Affiliate) 프로그램에 의해 저에게 일정 금액이 적립될 수 있습니다. ^_____^