I have a strange issue with a react native project. Building the project in XCode works fine, but building at the command line throws a strange error. Specifically this invocation (where values in <..> are replaced with real values)
Throws this strange error when linking the application:
Now this seems to be because the linking step is called like this:
What seems strange about this step is the it is using ld whereas in the build log in XCode this step is
The difference being that XCode appears to be linking using clang, whereas xcodebuild is linking using ld. Anyone any idea why this might be happening?
Code Block bash /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace <workspace name>.xcworkspace -configuration <configuration> -scheme <schema> -sdk iphonesimulator13.6
Throws this strange error when linking the application:
Code Block bash ld: unknown option: -target
Now this seems to be because the linking step is called like this:
Code Block bash Ld /Users/<username>/Library/Developer/Xcode/DerivedData/<project derviced data directory> normal x86_64 (in target '<target>' from project '<project>') cd /<project direvtory> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -target x86_64-apple-ios11.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk -L <list of libraries included>
What seems strange about this step is the it is using ld whereas in the build log in XCode this step is
Code Block Ld /Users/alex/Library/Developer/Xcode/DerivedData/<project derived data directory> normal x86_64 (in target '<Target>' from project '<project>') cd /<project directory> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios11.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk -L <libraries>
The difference being that XCode appears to be linking using clang, whereas xcodebuild is linking using ld. Anyone any idea why this might be happening?