iosxcodebuildxcode9simctl

Xcode 9: xcodebuild -exportArchive Error Reading File: info.plist


I have a project with multiple build configurations and build scripts that was recently migrated from Xcode 8 to Xcode9. It builds and runs fine to both simulator and device from Xcode, as well as archiving correctly. However, when I try to build or archive from the command line, it succeeds but the app crashes upon opening (on simulator) or gives an error message (when opening on device).

To archive from Jenkins Continuous Integration, I'm running

'xcodebuild -exportArchive -archivePath myApp.xcarchive -exportOptionsPlist ./build/exportArchive.plist -exportPath myApp.ipa'

and it creates an ipa, but when I try to open the ipa, it gives me this error:

"Unable To Install 'Error Reading File: info.plist' Please try again later."

and the app name itself is "ErrorReadingFile:info.plist"

When I open up the .ipa file that was exported it has no dSYMs or info.plist, only a Products folder with .app inside, and the .app file is entirely empty except for some iPad icon images (this should be a universal app).


Also, when I run the commands to build and deploy for simulator:

xcodebuild -sdk iphonesimulator -configuration Debug -project myApp
xcrun simctl install <whatever device id> myApp.app
xcrun simctl launch <whatever device id> com.whatever.myApp

It successfully installs the app and then crashes immediately after launch with no error codes. This is what shows up in the report after the simulator crash:

Crashed Thread: 0 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: DYLD, [0x9]

How do I get this to build/run/archive properly from the command line??


Solution

  • I can suggest making 'archive', and then 'export archive' directly from Xcode, just to figure out is it a problem with the build, or with scripts.

    You said you have multiple configurations. Maybe you are building the wrong scheme?

    Can you provide your build commands?

    Also, xcode 9 has new requirements to exportArchive.plist. And if you will do export archive directly from Xcode, it will save plist, which was used to export, with the export result. And you can use it later in your build scripts.