xcode - deptno/deptno.github.io GitHub Wiki

xcode

๋นŒ๋“œ

์›๊ฒฉ ๋นŒ๋“œ

  1. xcode ์‹คํ–‰
  2. iPhone ์„ ์ผ€์ด๋ธ”๋กœ ์—ฐ๊ฒฐ
  3. Window -> Devices and Simulators [shift + cmd + 2]
  4. Device ํ™”๋ฉด ์ƒ๋‹จ์˜ Connect via netowrk ๋ฅผ ์„ ํƒ

m1 issue

Application ์˜ XCode ์ •๋ณด๋ณด๊ธฐ์—์„œ rosetta2 ๋ฅผ ํ†ตํ•ด์„œ ์‹คํ–‰์‹œํ‚ฌ์ˆ˜ ์žˆ๋‹ค.(Intel)

react-native ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋Š”๋ฐ ์žˆ์–ด์„œ ์‹œ๋„ํ•œ ์กฐํ•ฉ์„ ๊ธฐ๋กํ•œ๋‹ค.

์„ฑ๊ณตํ•œ ์กฐํ•ฉ

  • alacritty(0.9 intel) system ruby(2.6.8p universal)
  • get install bundler(2.2.0 GEM_HOME ๋ณ€๊ฒฝํ›„ gem ์„ ํ†ตํ•ด ์„ค์น˜)
  • bundle install - ์–ด์ฐจํ”ผ ๋กœ์ปฌ ํ”„๋กœ๊ทธ๋žจ ์„ค์น˜์ผ ๋ฟ์ด์ง€๋งŒ, ์—ญ์‹œ๋‚˜ arch-arm64 ์˜ต์…˜์€ ์•„๋ฌด๋Ÿฐ ์˜ํ–ฅ์„ ๋ชป๋ฏธ์นœ๋‹ค.
  • bundle exe pod install - ์–ด์ฐจํ”ผ ๋นŒ๋“œ๋ฅผ ๋กœ์ปฌ์—์„œ ํ•˜๋Š” ๊ฐœ๋…์ด์ง€๋งŒ ์—ญ์‹œ๋‚˜ arch-arm64 ์˜ต์…˜์€ ์•„๋ฌด๋Ÿฐ ์˜ํ–ฅ์„ ๋ชป๋ฏธ์นœ๋‹ค.
  • xcode(intel)
  • xcode(arm64) ๋กœ๋„ ๋™์ผํ•˜๊ฒŒ ์„ฑ๊ณตํ–ˆ๋‹ค. alacritty(0.9 arm64)

intel ์€ ํ•ด๋‹น ๋นŒ๋“œ๊ฐ€ x86_64, rosetta2 ๋ฅผ ํ†ตํ•œ ์‹คํ–‰์„ ์˜๋ฏธํ•œ๋‹ค.

arch -arm64 ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค. ์ข…์†์„ฑ์— ์ด์Šˆ๊ฐ€ ์žˆ๋Š” ๊ฒƒ์ธ์ง€ native xcode ์—์„œ ๋นŒ๋“œ์— ์‹คํŒจํ–ˆ๋‹ค.

Undefined symbol: _pb_ostream_from_buffer
Undefined symbol: _pb_encode
Undefined symbol: _OBJC_METACLASS_$_GPBMessage
Undefined symbol: _pb_encode_string
...

ํ™•์ธ์‚ฌํ•ญ

xcode-select

$ xcode-select -p
# ์‘๋‹ต๊ฐ’์ด `/Applications/Xcode.app` ์ด ์•„๋‹Œ ๊ฒฝ์šฐ ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•œ๋‹ค.
$ sudo xcode-select --switch /Applications/Xcode.app

ํŒ€์„ค์ •

... .xcconfig:1:1: unable to open file (in target "XXApp" in project "XXApp")

XXApp -> TARGETS -> XXApp -> Signing & Capabilities -> Team: None

warning

Building targets in manual order is deprecated - choose Dependency Order in scheme settings instead, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current scheme to suppress this warning

-> Edit Schema -> Build Order -> Dependency Order

/path/to/react-native-app/ios/Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig:1:1: unable to open file (in target "App" in project "App")
bundle exe pod deintegrate # ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ์„์‹œ
bundle exe pod install

bundle exe pod install ์„ํ•˜๊ณ  ๋‚˜๋ฉด xcode ์—์„œ Pod ์˜ ์ƒ‰์ด ์ •์ƒํ™”๋˜๊ณ  ์ด ํ›„ ๋นŒ๋“œ์‹œ์—๋Š” ํ•ด๋‹น ์—๋Ÿฌ ์‚ฌ๋ผ์ง

error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Showing All Messages
: The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.

File -> Workspace settings... -> Build System: New Build System (Default) ๋กœ ๋ณ€๊ฒฝ

framework ์—…๊ทธ๋ ˆ์ด๋“œ์— ๋”ฐ๋ฅธ ์—๋Ÿฌ

info Found Xcode workspace "ZigbangApp.xcworkspace"
2022-06-07 16:19:51.718 simctl[24788:5981206] CoreSimulator detected version change.  Framework version (802.6.1) does not match existing job version (802.6).  Attempting to remove the stale service in order to add the expected version.
error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.
SyntaxError: Unexpected token I in JSON at position 0
    at JSON.parse (<anonymous>)
info Run CLI with --verbose flag for more details.
rm -rf ~/Library/Developer/Xcode/DerivedData/*

ld: symbol(s) not found for architecture x86_64

์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ์—์„œ๋งŒ ๋ฐœ์ƒํ•˜๊ณ  ์‹ค๊ธฐ๊ธฐ์—์„œ๋Š” ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”๋‹ค

โŒ  ld: symbol(s) not found for architecture x86_64
โŒ  clang: error: linker command failed with exit code 1 (use -v to see invocation)
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ZigbangApp.xcworkspace.
info Run CLI with --verbose flag for more details.

terminal ์ด arm ์œผ๋กœ ์‹คํ–‰๋œ ๊ฒฝ์šฐ

  • simulator ๋ฅผ x86_64 architecture ๋กœ ์‹คํ–‰ํ•œ๋‹ค
    arch x86_64 react-native run ios --simulator
  • xcode ์—์„œ Pods ์˜ Build Settings -> Build Active Architectures Only -> Debug -> Any iOS Simulator SDK์— arm64 ๊ฐ’์„ ์ถ”๊ฐ€ํ•œ๋‹ค

link

โš ๏ธ **GitHub.com Fallback** โš ๏ธ