A valid provisioning profile for this executable was not found for debug mode

Solution 1:

It could be because your iphone is not recognized by the provisioning portal.

Solution:

1) In Xcode, Goto --> Build --> clean all targets.

2) In "Groups & Files" -->Target --> expand it --> right click your app and select Clean "your app"

3) Goto->Window-->Organizer

4) In the Devices tab on the left, select your iphone

5) In the Provisioning section of the selected iphone delete all the current profiles (if any)

6) Unplug your iPhone and replug it in.

7) Goto->Window-->Organizer-->right click your iPhone -->Add device to provisioning portal

8) Now make sure you have selected the appropriate code signing identity in edit project settings -> build --> code signing

Build and run. Good luck!

Solution 2:

In Xcode 10, I solved this by switching the project's build system from "new build system" to "legacy build system" (File -> project Settings).

Solution 3:

I had the same problem. Everything was ok: the device was registered in IOS Provisioning Portal; the certificate was downloaded and the Development Provisioning Profiles for my app was downloaded.

So the solution!!!

Target> Get Info

Select Configuration to Release (here's the devil) In code signing, Code Signing Identity check iPhone Developer. Close.

On Target chose Clean Target and then Run the app.

Good Luck.