I'm having a issue compiling my app for Simulator. In the device runs perfectly but once I tried it to compile in simulator I get the following error:
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I checked before posting this question, but the answers I found in stackoverflow, like to run this,
export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
or
The problem was that Xcode 5 replaces gcc with clang and adds in a "-triple" option that specifies OSX as the target. If you pass "-miphoneos-version-min=7.0" on both gcc command lines it works. You can see the clang command line if you pass "--verbose" to gcc. It's also necessary to add to the PATH for Xcode 5 so that cmake can find the necessary tools: export PATH=/Applications/Xcode5-DP6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode5-DP6.app/Contents/Developer/usr/bin:$PATH None of this is official.. but works for me so far.
I dont really understand how to to do this. Any help, please?
This is expected, in general iOS simulator does not support bluetooth/BLE) devices, you would need to use a device in order to test anything related to Bluetooth.
The iOS simulator's architecture is x86_64 (the latest Xcode doesn't support an i386-based simulator that the answer refers to), whereas a real iOS device (such as an iPhone or iPad) can be arm64 or arm64e. So when building an app for the simulator you need to specify x86_64, not an ARM architecture.
The "build active architecture only" setting causes everything except the current Mac's architecture to be ignored (and the current one is of course valid), hiding the problem. Instead, you should look up a row or two in the settings, and change the "Architectures" setting to "Standard".
Check Build Settings
for your test target. This values should look similar:
If you have any escaped symbol, consider to fix it. I had here : \"
. I just removed them
Also notice: order is important!
P.S. from GraehamF It's always a good thing to Build -> Clean
and restart Xcode, so the changes to take affect
When I faced this error with an XCode project, I open the file ???.xcodeproj
(in a SubLime Text editor) and removed the below lines. The warning will no longer be there!
LIBRARY_SEARCH_PATHS = (
"\"${PROJECT_DIR}/../../../../../usr/lib\"/**",
"\"${PROJECT_DIR}/../../../../../usr/lib\"/**",
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With