问题
After agreeing to the "Upgrade to recommended settings" dialog in Xcode 7, my app build but no longer runs on the simulator. The simulator launches properly, but just sits on the home screen. Meanwhile, Xcode displays the error:
Installation Failed
Invalid Argument
回答1:
This happens because "Upgrade to recommended settings" will change the info.plist's CFBundleIdentifier
to point to $(PRODUCT_BUNDLE_IDENTIFIER)
instead of the old $(BUNDLE_IDENTIFIER)
.
Apple says in the Xcode 7 release notes that PRODUCT_BUNDLE_IDENTIFIER
is now "the recommended place to set the Bundle Identifier for a target." So if you're using BUNDLE_IDENTIFIER
anyplace else in your project, you have to change it to PRODUCT_BUNDLE_IDENTIFIER
to keep things in sync.
回答2:
This happened to me because somehow my info.plist
wasn't selected in my target application, so you just have to go YourProject
-> General
, and then look for issues or missing files.
I don't remember clearly what it was that fixed the issue, but that is the last thing I remembered from what actually fixed the issue, after following the accepted answer.
来源:https://stackoverflow.com/questions/32510153/installation-failed-invalid-argument-after-moving-to-xcode-7