Xcode expects this file to be cached after the first build and will fail on subsequent incremental builds. There appears to be no reasonable way to detect if a build is intended for archive/app store distribution.
Upstream commits: realm/realm-cocoa@cb8e3b6 and realm/realm-cocoa@453e0c1
This self-deletes the script during the build script phase. Does not address the CocoaPods use-case.