Note: This is from a long time ago and I haven’t really touched this stuff since around the time I wrote this. The information may be out of date. That said, if this does or doesn’t work for you, let me know and I’ll update this with the relevant info.
This is something I ran into a while back. If you’re not an iOS developer, but get tasked with building iOS apps, you may run into this. This particular exit code is fun because xcodebuild doesn’t tell you what the problem is.
Aside from building your app using the Xcode IDE, you also have the command line utility xcodebuild available to you. Assuming the code itself compiles just fine, this tool will tell you, for example, if you’re missing a provisioning profile or something.
When getting code 65, the build would fail with no explanation in the log. Rather, at the end it would say something like<com.apple.tools.product-pkg-utility> "/Users/[me]/Library/MobileDevice/Provisioning Profiles/12345678-ABCD-1234-ABCD-1234567890AB.mobileprovision" -o "/[my_project_build_location]/embedded.mobileprovision"
*** BUILD FAILED ***