리액트 기본 ios/Podfile
마스터욱
0
14
0
0
2025-01-15 22:59:39
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '15.6' # 프로젝트의 최소 iOS 배포 타겟을 명시적으로 설정
prepare_react_native_project!
use_modular_headers! # use_frameworks! 보다 먼저 선언해야 함
# use_frameworks! 설정. :static 또는 :dynamic 선택 가능.
# :static은 앱 크기를 약간 늘리지만 링킹 문제를 줄일 수 있음.
# :dynamic은 앱 크기를 줄이지만 링킹 문제가 발생할 가능성이 약간 있음.
use_frameworks! :linkage => :static
def common_pods
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => true # Hermes 엔진 사용 여부
)
end
target 'ggongsulapp4' do
common_pods
# 필요한 경우, 메인 앱 타겟에만 필요한 Pod들을 여기에 추가
# 예: pod 'Firebase/Core'
end
post_install do |installer|
react_native_post_install(installer)
# M1/M2 Mac 시뮬레이터 빌드 문제 해결을 위한 설정 (필수)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
end
# iOS 배포 타겟을 Pods 프로젝트에도 명시적으로 설정 (권장)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.6'
end
end
end