iOS 물리 기기로 실행

Tags
ios
device

물리 Device에서 실행하기

1) 커맨드 이용해서 바로 기기로 빌드

$ npm install -g ios-deploy # 물리기기에 설치하려면 해당 모듈 필요 # 기기 이름, UUID 파악 $ ios-deploy -c [....] Waiting up to 5 seconds for iOS device to be connected [....] Found c65f958bbef8af585a9bb096d8a6a6138bc8e859 (D201AP, iPhone 8, iphoneos, arm64) a.k.a. 'iPhone' connected through USB.
 
$ npx react-native run-ios --device # usb로 연결된 물리기기가 하나라면 이렇게 해도 됨. $ npx react-native run-ios --device '기기명' # 특정 장비를 명시하는 경우 $ npx react-native run-ios --device '기기명' --configuration Release # metro bundelr와 연결이 안되는 경우 릴리즈로 ㄱㄱ

2) Xcode에서 물리기기로 바로 빌드하기

1 - Device를 USB로 MAC에 연결
2 - 코드사인 설정하기
일단 개발자 계정 가입하고.
ios 폴더로 이동해서 .xcodeproj 파일을 열거나 CocoaPods를 사용한다면 .xcworkspace 파일을 열고
notion image
프로젝트의 Signing 설정.
notion image
3 - 빌드해서 실행하면 됨.
notion image
4 - 이슈가 있다면 아래 링크 참조
겪은 이슈 사항
.xcodeproj 파일로 열었더니 YogaKit.modulemap이 없다는 에러가 뜸.
.wcworkspace로 열면 정상빌드됨 (Pods 때문인듯)
notion image
notion image
notion image