在macOS 10.12上运行为模拟器构建的mach-o文件

时间:2017-09-08 16:55:12

标签: ios xcode

我已经更新了macOS(10.11-> 10.12.6)和xcode(? - > 8.3.3),现在我无法运行为iPhoneSimulator构建的测试。测试是命令行可执行文件。 据我所知,它适用于以前的版本。构建命令没有改变。

构建

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C "../build_release" -r -f ../../build/Makefile.test test_case_a
clang++ -o test_case_a.o -c -MMD -g -O2 -DUSE_PTHREAD -stdlib=libc++ -m32 -mrtm -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -miphoneos-version-min=8.0 -Wall -std=c++11  -I../../src -I../../include -I.  ../../src/test/test_case_a.cpp
clang++ -o test_case_a.exe -g -O2 -DUSE_PTHREAD -stdlib=libc++ -m32 -mrtm -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -miphoneos-version-min=8.0 -Wall test_case_a.o libtesttarget.dylib   -lpthread  -m32 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/usr/lib/system -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/usr/lib/ -miphoneos-version-min=8.0

# running:
./test_case_a.exe
dyld: mach-o, but built for simulator (not macOS)
make[1]: *** [test_case_a] Abort trap: 6

来自xcodebuild -sdk -version

iPhoneSimulator10.3.sdk - Simulator - iOS 10.3 (iphonesimulator10.3)
SDKVersion: 10.3
Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk
PlatformVersion: 10.3
PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
ProductBuildVersion: 14E8301
ProductCopyright: 1983-2017 Apple Inc.
ProductName: iPhone OS
ProductVersion: 10.3.1

0 个答案:

没有答案