问题
After I upgraded to Xcode 8, I am unable to debug on the device due to the following error:
App installation failed. No code signature found.
My setup, observations and what I've tried so far:
- The device has iOS 10 installed
- Code signing and debugging on the device in Xcode 7 works (no changes made to the code signing)
- The app has a watch app (build/run without watch app didn't change anything)
- Refreshing provisioning profiles, removing all of them and redownloading them didn't change anything
- Removing ALL code signing setup from the build settings and enabled "automatically manage signing", which also didn't help
- I'm always cleaning the build folder
- I've tried restarting the device, xcode, the mac
- My colleague reports the same issue with the same project
- I've tried reverting the changes Xcode 8 suggested (build settings, warning fixes, ...)
回答1:
older answer is wrong
I got the same problem here, I have five project, and the four of them can not debug on device and only one can debug on device. I compared the Xcode project files and did not figure it out. I believe it is a provisioning profile issue. it seem that the Xcode will generate the development provisioning profile in your Xcode and did not upload it to your apple developer account.
update:
I finally solve my problem, it seems like a third framework manual set the codesign identity or privisioning profile in the signing seciton of build setting. then you install this third framework, in the codesigning phase, Xcode will search the non-existing codesign identity or privisioning profile for this framework, then it failed.
回答2:
I was finally able to solve it with the following:
- Update
carthage
(0.18 is currently the latest version). For some reason the code signing was not applied correctly. - In build settings set
PROVISIONING_PROFILE
andPROVISIONING_PROFILE_SPECIFIER
both to the same and correct profile - I had to disable
automatically manage signing
In conclusion, all my provisioning profiles were correct and the problem was only related to code signing the frameworks and not to the app itself. If the error message would have stated where specifically No code signature
could have been found, it would have saved quite some debugging time...
回答3:
presumably you're using cocoapods? I had to manually set 'Automatic manage signing' & respective team then it finally worked. Thanks for the pointers from other commenters. For me - there's two development Teams working on same project - so not sure this solution is going to be best. Need to find way to do this at Podfile level.
N.B. I'm on cocoapods - 1.2.0
UPDATE - try this / edit Podfile and add to bottom. run Pod install
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
IF THE ABOVE DOESN'T WORK - ONLY try this ( you may need to adjust to latest SDK eg. iPhoneOS10.2.sdk n.b. P.S. some body said they had to run PlistBuddy as sudo /usr/libexec/PlistBuddy)
killall Xcode
/usr/libexec/PlistBuddy -c "Set :DefaultProperties:CODE_SIGNING_REQUIRED NO" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist\n
/usr/libexec/PlistBuddy -c "Set :DefaultProperties:AD_HOC_CODE_SIGNING_ALLOWED YES" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist\n
/usr/libexec/PlistBuddy -c "Set :DefaultProperties:CODE_SIGNING_REQUIRED NO" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/SDKSettings.plist\n
/usr/libexec/PlistBuddy -c "Set :DefaultProperties:AD_HOC_CODE_SIGNING_ALLOWED YES" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk/SDKSettings.plist\n
xcodebuild clean build
来源:https://stackoverflow.com/questions/39558199/xcode-8-no-code-signature-found