Skip to content

Instantly share code, notes, and snippets.

xctest[18838:9855653] The bundle "ios-framework-packagePackageTests.xctest" couldn't be loaded because it is damaged \
or missing necessary resources. Try reinstalling the bundle.
xctest[18838:9855653](dlopen_preflight(./ios-example/ios-framework-package/.build/x86_64-apple-macosx10.10/debug/ios-framework-packagePackageTests.xctest/Contents/MacOS/ios-framework-packagePackageTests):
**Library not loaded: @rpath/libswiftUIKit.dylib**
...
Reason: no suitable image found. Did find:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libswiftUIKit.dylib: mach-o,
**but built for simulator (not macOS))**
swift test --verbose \
-Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \
-Xswiftc "-target" -Xswiftc "x86_64-apple-ios12.1-simulator" \
-Xswiftc "-lswiftUIKit"
$ otool -l .build/debug/ios_framework_package.build/ios_framework_package.swift.o
...
Load command 6
cmd LC_LINKER_OPTION
cmdsize 32
count 2
string #1 -framework
string #2 UIKit
...
$ otool -L .build/debug/ios-framework-packagePackageTests.xctest/Contents/MacOS/ios-framework-packagePackageTests
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
======
/System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 61000.0.0)
======
@rpath/XCTest.framework/Versions/A/XCTest (compatibility version 1.0.0, current version 14460.20.0)
@rpath/libswiftCore.dylib (compatibility version 1.0.0, current version 1000.11.42)
@rpath/libswiftCoreFoundation.dylib (compatibility version 1.0.0, current version 1000.11.42)
@rpath/libswiftCoreGraphics.dylib (compatibility version 1.0.0, current version 1000.11.42)
Compile Swift Module 'ios_framework_package' (1 sources)
Compile Swift Module 'ios_framework_packageTests' (2 sources)
Linking ./.build/x86_64-apple-macosx10.10/debug/ios-framework-packagePackageTests.xctest/Contents/MacOS/ios-framework-packagePackageTests
xctest[77129:8746476]
The bundle "ios-framework-packagePackageTests.xctest" couldn't be loaded because it is damaged \
or missing necessary resources. Try reinstalling the bundle.
xctest[77129:8746476](dlopen_preflight(.build/x86_64-apple-macosx10.10/debug/ios-framework-packagePackageTests.xctest/Contents/MacOS/ios-framework-packagePackageTests):
**Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit**
@dive
dive / SPM:Article:Swift:Test.sh
Created February 25, 2019 12:31
SPM:Article:Swift:Test
swift test \
-Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \
-Xswiftc "-target" -Xswiftc "x86_64-apple-ios12.1-simulator"
@dive
dive / SPM:Article:NM.sh
Created February 25, 2019 12:30
SPM:Article:NM
$ nm -extern-only -defined-only -just-symbol-name .build/x86_64-apple-macosx10.10/debug/ios_framework_package.build/ios_framework_package.swift.o
_$S12CoreGraphics7CGFloatVACSBAAWL
_$S12CoreGraphics7CGFloatVACSBAAWl
_$S12CoreGraphics7CGFloatVACSLAAWL
_$S12CoreGraphics7CGFloatVACSLAAWl
_$S21ios_framework_package16FrameworkPackageC11randomColorSo7UIColorCyF
_$S21ios_framework_package16FrameworkPackageCACycfC
_$S21ios_framework_package16FrameworkPackageCACycfc
_$S21ios_framework_package16FrameworkPackageCMa
_$S21ios_framework_package16FrameworkPackageCMm
@dive
dive / SPM:Article:Lipo.bash
Created February 25, 2019 12:29
SPM:Article:Lipo
$ lipo -archs .build/x86_64-apple-macosx10.10/debug/ios_framework_package.build/ios_framework_package.swift.o
x86_64
@dive
dive / SPM:Article:Compile:Module.log
Created February 25, 2019 12:29
SPM:Article:Compile:Module
Compile Swift Module 'ios_framework_package' (1 sources)
@dive
dive / SPM:Article:Swift:Build:Params.sh
Created February 25, 2019 12:28
SPM:Article:Swift:Build:Params
swift build \
-Xswiftc "-sdk" -Xswiftc "`xcrun - sdk iphonesimulator - show-sdk-path`" \
-Xswiftc "-target" -Xswiftc "x86_64-apple-ios12.1-simulator"