问题
I've managed to sign my app and have archived it in Xcode 4.2 but when I go to the organiser and press ether 'Validate' or 'Submit' (and after going through the two sheets for iTunes Connect login and application record and signing) I get an error "The operation couldn't be completed. Bad file descriptor". Restarting Xcode did not fix the problem.
I've also tried the Application Loader app included in the developer tools but I can't figure out what kind of file it's looking for since it won't allow me to choose either the built app bundle or a .zip of said bundle for upload.
I'm not the only one with the problem as there's a thread on the Apple Developers' Forum about this but there's no resolution there. I've seen a posting on another forum that says the problem is 'missing application tools' but there's no elaboration on that.
回答1:
This turned out to be what got rid of it for me:
cp <xcode-install-directory>/usr/bin/*build /usr/bin/
I previously did a clean install of Xcode too, though, so I can't promise this is all it took.
回答2:
Press Command+Space, type Terminal and hit Enter
sudo cp /Developer/usr/bin/*build /usr/bin/
sudo cp /Developer/usr/libexec/productutil /usr/libexec/
Now you can submit the same archive again. Clean and Archive should not be necessary. If you have not installed XCode at the default path, you should exchange
/Developer
for that path in the commands above.
回答3:
I closed Xcode and restarted my mac. Everything worked fine!
回答4:
I had the same problem. Similar solution from here https://devforums.apple.com/message/597839 however no need to uninstall, just reinstall 3.2.5 over 4.2, install missing application tools 1.1 and then reinstall 4.2
来源:https://stackoverflow.com/questions/8423575/submitting-a-mac-app-fails-with-bad-file-descriptor