The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).

在进行 Profile 真机调试的时候,报

Profile The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).

但是正常打包,运行都是正常的。查找了半天。网上的情况大多是 run 就报这个错的,无耐自己来排除错误。
自己新建了一个空白工程测试,发现默认就是 Release 的,但是 Profile 可以正常运行,仔细查找发现 Code Signing 是 Auto,查看编译日志,发现Auto 用的 Provisioning Profile 是 Development。
到这里恍然大悟,XCode 在 Code Signing 的时候,Profile 会选择 Development 的 Provisioning Profile,而我们是指定的 Release 下的 Provisioning Profile,所以 Xcode 才会报错。

所以解决方案就是 Scheme->Profile 从默认的 Release 模式,改为 Debug 就可以正常调试了。

附 查看Provisioning Profile信息的 shell:

/usr/bin/security cms -D -i profile_path/profileName.mobileprovision"

你可能感兴趣的:(The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).)