“A valid provisioning profile for this executable was not found” error when trying to run unit tests

孤者浪人 提交于 2019-11-28 10:26:06

I was running into similar error when installing app to iPhone 5 & iPhone 6. The same app install just fine (using Xcode 6). But it kept giving me errors like:
A valid provisioning profile for this executable was not found
The code signing and profile setting were good and valid. I tried different ways people have suggested but none of them solve my problem. If you are running into the similar problem when trying to run your app on iPhone 5 & above, and getting the error message, here is what you can try:
1) Go to apple developer web site and add the device (iPhone 5/6) to the development device list;
2) On the same web site, click on Provisioning profile and download development provisioning profile to your local computer;
3) Go to Xcode -> Devices, right click on the iPhone you want to run your app (which you added it to your development device list on apple developer web site);


4) Select "Show Provisioning Profiles". A popup window will show the profiles for the device. Click on "+" sign and select the provisioning profile you just downloaded.
The profile will be installed for this device and you are ready to go.
I have found this procedure works whenever you want to add a new phone for development.

After a lunch break, I figured this out: The Bundle Loader setting for the unit-test target was not referring to the application target I thought it was. It was, in fact, pointing at a target with an invalid provisioning profile.

It's interesting that the unit tests did run on an iOS 6 device, even with the incorrect profile. I guess iOS 7 does some additional verification.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!