Error: Command CodeSign failed with a nonzero exit code Xcode in 13.2.1

I got this Codesign error when attempting to run one of my applications on my iPhone, I tried a couple more of my apps and i still get the same error. Also, I only get this error when I’m running the app on my iPhone that’s plugged into my computer but I get no errors when running on a simulator. Thus, this error seems to be due to my iPhone.

From what I read online I tried the following:

  1. Restart both my Mac and iPhone
  • no success. I tried multiple times and still got the same error.
  1. Check my provisioning profile and certificates
  • everything looks fine but I'm a newbie so I could be wrong.

What I noticed that may be causing the error:

  • I stopped using Xcode for about 3 months and during that time I updated my iPhone version to 15.6.1, but the iOS Deployment Target only goes up to 15.2.

So with all this said, is it possible to run an older version say 15.2 when your iPhones version is higher (like mine which is 15.6.1)?

^ If this is possible, where else could this error be coming from?

Thank you!

Error: Command CodeSign failed with a nonzero exit code Xcode in 13.2.1
 
 
Q