What is libswiftRemoteMirror.dylib and why is it being included in my app bundle? What is libswiftRemoteMirror.dylib and why is it being included in my app bundle? ios ios

What is libswiftRemoteMirror.dylib and why is it being included in my app bundle?


In my case I got ERROR ITMS-90171 because I am using custom frameworks.

"Invalid Bundle Structure - The binary file 'MyFramework.framework/libswiftRemoteMirror.dylib'

(I didn't get it for my application.)

I tried gym but it got stuck at xcrun. So I tried doing rm -rf libswiftRemoteMirror in the build phrase (with a custom run-script) for every custom framework I have and interestingly I didn't break anything: it worked.


Recently started using Swift for our project and got same error.

To find a root cause, I just did 'grep -Ril "libswiftRemoteMirror" .' in XCode.app (I have 10.1 currently) and found ./Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/swift-stdlib-tool.xcspec file. It says:

     // SWIFT_RESOURCE_DESTINATION and SWIFT_RESOURCE_LIBRARY allow us to copy    // libswiftRemoteMirror.dylib into place so that memory debugging tools have access to it    // on device.    // We disable these options in "DEPLOYMENT" modes, so that the libswiftRemoteMirror.dylib    // does not make its way into archives submitted to the App Store.


So solution is simple - in XCode target settings set Deployment Postprocessing to Yes for your Release configuration (or whatever you use for build)


I ran into the same problem after installing Xcode 8, by building via shenzhen.

I decided to look at Fastlane as an alternative, and their gym program produces an ipa that can be submitted to Apple.

It was reasonably easy for me to replace the call to ipa (shenzhen's executable) with a call to gym, and the rest of my build-and-upload scripts worked without modifications.

If you prefer to build directly, I lifted the following from the gym readme. It produces an .xcarchive containing an .app file without the libswiftRemoteMirror.dylib. I don't use that kind of flow myself, so I can't say how you would proceed from there.

xcodebuild \  -scheme Scheme \  -workspace Project.xcworkspace \  -configuration 'Release' \  -destination 'generic/platform=iOS' \  -archivePath './Output.xcarchive' \  archive