Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

xcode - "A valid provisioning profile for this executable was not found" error when trying to run unit tests

I have an Xcode workspace with unit test targets. The unit tests run fine in the simulator, and also run fine on one of my devices (a 4th-gen iPod touch running iOS 6). However, on two other devices (an iPad Air and a 5th-gen iPod touch running iOS 7), when I try to run unit tests I get an alert saying

A valid provisioning profile for this executable was not found

I only get this when running unit tests. If I try to Run the app on these devices, it installs and runs fine.

I have verified that the (developer) provisioning profile set in the Code Signing build settings for the app includes these devices and that it matches my developer code-signing identity and the App ID. I have also tried recreating, re-downloading, and re-installing the profile.

Where should I look? Why would the provisioning profile for Test not be valid when it is valid for Run?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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);
Show Provisioning Profiles
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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...