From the Project Editor, choose a target and select General.
In the bottom left corner of the window, press the + sign, then Add Apple ID. From the top menu, select Xcode, then choose Preferences. Keep in mind that all targets in a bundle should use the same signing method.) Here's an in-depth tutorial on how to manually sign your app. (In some cases, you might prefer manual signing. If automatic signing is already enabled or if you don't need help with signing, you can skip to step two.
If automatic signing is enabled, Xcode will create and manage certificates, signing identities, and handle device registration for you. The easiest way to do this is through Xcode. In order to distribute your app to beta testers or to users through the App Store, you'll need a separate distribution provisioning profile and distribution certificate. The development provisioning profile and development certificate that you've been using are only for specific devices. Code Signing: Create an iOS distribution provisioning profile and distribution certificate