How do I code sign ios app using xcode ? (For clients) - ios

How can I code sign Ios app using xCode for a client. He already sent me a certificate and a provisioning profile but how to use them to code sign the app.
Notes:
1- I don't have an apple developer account.
2- the app is developed by Unity.
3- I used cocapods for google play services to work on Ios this is how I used it (Check out FaHu answer).
Please help I've never used xCode before so am new to Ios in general if you can provide a step by step that will be so appreciated as am stuck to do this for a month and a half.

First of all, import the Development Certificate into Keychain Access by clicking on it. Then, go ahead and add the provisioning profile to Xcode by clicking on it as well.
In Xcode, go through the following steps:
In the upper left corner, click on the Xcode project icon
Go ahead and click on PROJECT, then Build Settings at the top.
In the next view, scroll down until you find the "Code Signing" area. For "Code Signing Identity", go ahead with the name of your Certificate (click on the current value for a dropdown). You do that for both, "Debug" and "Release" as well as for "Any iOS SDK". Then, you click on the provisioning profile and choose your clients profile.
Repeat steps 2 & 3, but this time not for PROJECT, but for your TARGET on the left side. Also, For the target go to the "General" tab and choose the Team your Certificate is bundled to from the dropdown window.
Be sure to login with the Apple ID the certificate is bundled to. You can do that in the Xcode settings (cmd + ,).

Related

Code signing is required for product type 'Application' in SDK 'iOS 10.0' - StickerPackExtension requires a development team error

I am facing the below issue and am unable to build the application.
XXX has conflicting provisioning settings. XXX is automatically
provisioned, but provisioning profile WildCard has been manually
specified. Set the provisioning profile value to "Automatic" in the
build settings editor, or switch to manual provisioning in the target
editor. Code signing is required for product type 'Application' in SDK
'iOS 10.0'
I am also unable to choose a particular profile.
How to resolve this issue?
Holy molly, I had to do all this in order for it to work. A picture is worth a thousand words.
If you get this error while archiving then continue reading.
Go to your app and click on the general tab. Under the signing section, uncheck "Automatically manage signing". As soon as you do that you will get a status of red error as shown below.
Now here's the tricky part. You need to uncheck "Automatically manage Signing" in both the targets under your project. This step is very important.
Now go under "build settings" tab of each of those targets and set "iOS Developer" under code signing identity. Do the same steps for your "PROJECT".
Now do Xcode → Product → Clean. Close your project in Xcode and reopen it again.
After this go to the general tab of each of your targets and check "Automatically manage signing" and under team drop down select your developer account
Do an archive of your project again and everything should work.
Really, Apple? Was this supposed to make our lives easier?
Great, now we can choose the profile for Debug and Release separately in the general tab itself as illustrated in the image below.
Also when you click on Automatically manage signing it does all process that are created by Fix issue in previous Xcode versions.
Disabling automatic and then re-enabling has solved this for me in Xcode 8 GM seed. This can be done in the project settings, info tab for each target that needs to be signed.
I hate to say it. I just quit Xcode and opened it again. Simple and effective :)
For resovle this issue:
Go to Xcode/Preferences/Accounts
Click on your apple id account;
Click - "View Details" (is open a new window with "signing identities" and "provisioning profiles";
Delete all certificates from "Provisioning profiles", empty trash;
Delete your Apple-ID account;
Log in again with your apple id and build app!
Good luck!
This is what I would call a classically Apple Xcode UX design bug.
The error said there is a bunch of stuff YOU DID WRONG LOCALLY.
The error actually meant "we have a new agreement you did not accept online".
After checking and unchecking the Automatic Signing button I got this agreement error to display:
Signing into the developer portal I was able to see a banner for the agreement update notice:
.
Restarting Xcode 8 then cleared that error and only forced me to reselect the certificate I already had on my machine and tied to the project.
This could have been handled in a less confusing implementation, but this is how I fixed it. I am putting it here because it's way different than the steps everyone else gave.
Oh and yeah, having the pre-latest iOS 10 device and latest Xcode (I was on 7.3.1 or something) also threw errors until I updated.
This is how it worked for me:
Kill Xcode and launch again
Open project again
Clean Project
Go to project settings > general > uncheck 'automatically managed profiles' and than 'check' again it will prompt for enable.
Now try archiving the source code
P.S Killing Xcode and launch again is the best thing to do if facing any random issue
I fixed it doing this:
Set your team for all the targets of your project. Including the extensions. And left the automatic signing management.
Steps:
Under General → Signing
Uncheck: Automatically manage signing
Select Import Provisioning
The Untick-tick (check-uncheck) "Automatically manage signing".) of Xcode checkboxes don't work for me (as many suggested on the top).
It happens with frameworks linked in your project.
Solution:
Find your framework or any other target that required signing.
Go to Build settings
Search Signing Identity
Set Don't code sign manually.
I only needed to uncheck 'Automatically manage signing', check it again, and rebuild.
Click on Add Account if not signed in.
Then after select your team profile and check Automatically manage signing and leave everything else as is in Xcode. It will perform the remaining stuff by itself.
I ran into this type error by updating the Xcode version to 8.0,
and under the Code signing is required for product type 'Application' in SDK 'iOS 10.0'
There is a warning:
isn't code signed but requires entitlements. It is not possible to add entitlements to a binary without signing it.
My solution is go to the TARGET → General → Signing -> click the Enable signing... button, and I solved the issue.
If you are finding the following screen and facing the problem of code signing required, then one of the following solutions may help you.
Solution 1. As said before, sign in with an Apple ID. Then you will get options like this, if you enter correct bundle identifier. Then select the appropriate profile from the list.
Solution 2. If you don't want to sign in with your Apple ID, then change a small flag in project.pbxproj file. Find the following text in the project file.
/* Begin PBXProject section */
Change flag ProvisioningStyle = Automatic; to ProvisioningStyle = Manual; Refer to the following image. After changing the flag, you will see the options to select appropriate profile from the list.
in Build Setting change in Signing
Clean and Archive your code , Hope it will help you .
Xcode Version 11.0:
I recently upgraded to Xcode Version 11.0.
Looks like Apple moved the Signing to a new tab from the original General tab.
Navigate to the application
Select "Signing & Capabilities"
Click "Enable Development Signing"
Firstly in general tab -> signing section -> select a development team, manage signings
Similarly if you are working with multiple pod files select each pod target separately and go to general tab -> signing section -> select a development team, manage signings
repeat the same process for all pods in your project
Clean -> Build the project.
This worked for me
In unit test target
Xcode 7:
Must have provisioning profiles set (the same as in app target)
Must have "don't sign" under certificates
Xcode 8:
Must have 'None' set for provisioning profiles
Must have certificates set (the same as in app target)
(Must also have 'None' set for deprecated provisioning profiles)
All answers looks fine but i found still issue so i changed settings in Build like this in XCode 9.0 - Sharing it so it could help someone.
After applying all the solutions above, The same issue I was getting. i.e
So I solved this by removing the provision profile in build sending.
Please find the images which will make you more clear
Even when installing the Watch OS application extension, the same error occured in Xcode 8.1:
After updating the Provisioning Profile to Empty in Project of Build
Settings, everything work fine.
&& Code Signing Identity to iOS Developer in every targets Build Settings.
I upgraded to Xcode 8, and iOS 10, but I had the problem.
I fixed it by going to project general tab, signing section.
Click "Enable signing....."
That is it.
If you get this error while compiling in Microsoft Mobile Center
❌ Code signing is required for product type 'Application' in SDK
'iOS 10.3'
** ARCHIVE FAILED **
be aware that Mobile center doesn't yet support automatic signing with certificates of type app-store, ad-hoc and enterprise. Automatic signing only works with development certificates.
There are two things you can do to work around that limitation:
Use a development certificate. You'll have to create a new one in the developer.apple.com portal, download it to your machine, export it to a .p12 file using keychain, then finally provide it to Mobile Center. You know the drill.
Disable automatic signing. You will find that setting in Xcode in your project targets. Once disabled, a little "i" button will be displayed next to the "Xcode managed profile" label. Click that button, some info about the profile will be displayed. On the top left corner of that window, a "PROV" icon is displayed. That is the provisioning profile that you should provide to Mobile Center. Drag and drop the icon into the corresponding field in Mobile Center.
.
I did everything and didn't worked. I uninstalled Xcode 10 and installed Xcode 9.4 then it worked out of the box !
If you still have problem then please try this.
Build Settings -> User Defined -> Provisioning profile (Remove this.)
It will solved my issue.
Thanks
I have tried above all issue but was not working for me
What I tried is
First of all, I want to go with manual code signing process, I am not doing via automatic code signing
I specify team name
Then change deployment target
Clean and build
You will good to go now
1.1: If you are using p12 and a provision file, but not using AppID to log in, do not Select Automatically manage signing.
Which means you don't need to set your team. Just select your provision file and the machine code signing identity in Build Settings, like this Build Settings. Make sure the parameters are set as well.
And then go back to General. You will see General set, and that's OK.
If 1 does not work, try as other answers said, clean your project, delete the derived data folder, quit Xcode, and open again.
Just download your provisioning profile again from your developer account.
And sign out all developer accounts from Xcode → Preferences → Accounts → *Select Account showing at left and press -(subtract sign)
After deleting all accounts, press the + sign (add) button and sign in with all developer accounts.
It will work like a charm...
It is because you have not choosen a team when you created the project.
I am such fixed. And I choose it in build settings, but invalid. I must create a new project.
"I choose it in build settings, but invalid. I must create a new project." is wrong.
It is invalid because I have not chosen it in extension. You must choose a profile at your project's all extension, and there is no need to create a new.
[2
select your target and search for user-Defined section on build Settings,select provisioning profile and delete it

Xcode doesn't show options in build settings

I developed a game with Unity and created the Xcode project, so now I want to publish the game to the App Store. I bought the license and set the correct key in the Mac, but there's a problem: I can't select options in the build settings; it show me only a blank text area. The first time I opened the project, I was able to change the configuration and Xcode showed me the options.
How i can fix this problem?
this is a screen:
Are you planning to change provisioning profile and code signing identity?
It's under Code Signing section. Under that set the correct developer, publisher profiles and provisioning profile.

iOS- Provisioning profile issues.

OK, so I have tried everything possible but still having issues.
I am testing on two devices. An iPhone and an iPad. When I connect the iPhone to Xcode and hit run it builds on the iPhone without any problems but when I connect the iPad to Xcode and hit run it fails and gives me this
This product type must be built using a provisioning profile, however
no provisioning profile matching both the identity
I used to be able to test very easily before I upgraded to Xcode5.
Now it works on one device but not the other. Can anyone please tell me how I can fix this?
All my devices are upgraded to iOS 7.1 as well.
In order to fix this problem, please follow these steps:
I. Go to Xcode Settings (Xcode -> Preferences), and select "Accounts." Make sure you are signed in to your developer account.
II. Click on the first tab under the run button, and then click on the name of the project (circled in red)
III. Under "Identity" select the account that matches your build identifier, or click "Fix Issue"
IV. If this does not fix your issue, go to "Build Settings" -> "Code Signing"
V. Finally: If this does not fix your issue, go back to the Certificate Center in the iOS Developer Center (developer.apple.com) and reprovision the certificate, then repeat these steps.

which certificate and provisioning profile are used to sign my application?

I'm try to develop an iOS app and the current Build Settings are:
Code Signing Identity
Debug: Don't code sign
Any SDK: iOS Developer
Release: Don't code sign
Any SDK: iOS Developer
Provisioning Profile: None
How come that I'm still able to run the app on my iPad even though I've not selected any Provisioning Profile and selected "Don't code sign" for the Debug setting?
Is there a way to see which profile was selected for this app (even though I didn't select any)?
You can see what code signing identity and profile are being used by looking at the build logs in Xcode. Go to View > Navigators > Show Log Navigator. Find your latest build and select "All Messages" at the top of the log. Scroll down towards the bottom of the log and you should see a "CodeSign app_name.app" entry. click on that and expand it by clicking the 3 little lines on the right side. The log will then say "Using code signing identity "foo" and provisioning profile "bar"

No identities were available - administrator request

I had problems while "archiving" my app. I think there are invalid profiles because of iPhone Update to 5.1 and XCode update to 4.2.2.
I've taken now more than 4 hours to get rid of certification issues while using this thread step by step 3 times (which costs a lot of time):
Getting "A valid signing identity matching this profile could not be found in your keychain" warning
I still have the following fault:
No identities were available
An administrator must request identities before they can be downloaded.
The "Download identities" button went back to this window after processing some seconds.
Do you know how to get out of this wood of certification documentations and solve that fault?
Visit Member Center
Go to "iOS Provisioning Portal" -> "Certificates" (Left sidebar) >> "Distribution" tab
Check field "Provisioning Profiles". If empty, next (4)
Go to "Provisioning" (Left sidebar) -> "Distribution" tab. Press "New Profile" and complete it.
Go back to (3) check the field again.
Download and "run" (double click) the new provisioning profile.
In your project's build settings select the NEW provisioning profile (it might have the same name as the old one)
In your project's build settings update your code signing identities (all of them) to the new one if there is one. (The old one was probably expired which is one of the biggest causes for the error message you saw)
Verify that your bundle ID is correct (CaSe SeNsEtIvE)
Back to XCode Organizer - Devices. Click TEAM (Left sidebar) and click "Refresh" (right-bottom). You will find XCode fetch the new profile. If new content loaded, repeat steps 6 and 7 (they will have been changed!) *If you can't find team because you are running a newer version of xCode, go to Xcode preferences (clicking "Xcode" on the mac toolbar on the top left corner of your screen) and go to account, select your team and click refresh. If new content loaded, repeat steps 6 and 7 (they will have been changed!)If you are in Preferences -> Accounts and you still can't refresh, then:
Click on the Accounts tab
Select an Apple ID in the list
Click "View Details" on the bottom right
Click on the refresh arrow on the bottom left
Xcode will now refresh the updated credentials, and you can proceed to validate or distribute your app.
Validate or distribute your app again. It should work.
If this didn't work then go to "TEAM" under project settings > targets and select "none"... Now that you have selected None you will need to repeat step 7 and change the code signing identities (all of them) and try archiving again.
Lastly, if none of the above worked. Simply create a new production certificate AND create a new provisioning profile with the same bundle ID. (Yes, this will work if you are updating an app that is already live). Download the cert and prov. profile and run both (double click). Now repeat step 6 and archive. This should work.
#Takoi's answer is correct. However, with my latest version of Xcode, there is no TEAM option in the Devices section of the Organizer. I had to do the following instead to refresh the credentials:
Go to Xcode->Preferences
Click on the Accounts tab
Select an Apple ID in the list
Click "View Details" on the bottom right
Click on the refresh arrow on the bottom left
Xcode will now refresh the updated credentials, and you can proceed to validate or distribute your app.
Hope this helps!
Make sure the bundle id in your .plist file in XCode is the same as the bundle id in itunesconnect, if it's off, it won't be able to match the archive to the profile on itunesconnect when validating/distributing.
This is a little easier now.
You go to the app itunesconnect and login
click "certificates"
Provisioning Profiles / Distribution
generate a profile,
download the profile
double click it
I am a member of 2 teams and had the same problem while uploading one of the projects.
Changing General -> Identity -> Team to None in project settings (XCode 5) allowed me to upload the application to iTunesConnect.
Screenshot is here
My certificate had expired which resulted in my provisioning profile being expired.
Once I -
Updated my certificate on the iOS web portal
Clicked Edited on the provision profile
Selected the new certificate and clicked generate
In Xcode I refreshed my provisioning profiles
Error went away
I guess it is written somewhere in the stream, I did not read all in detail. I just want to emphasise on this point:
Due to an annoying xCode behavior, once you've set up everything, you HAVE TO clean the project and Quit xCode.
Then relaunch and build. Now you know if it works or not.
It looks like you're going to have to request another developer cert. Go to the iOS dev center website and go to the provisioning portal. Click the certificates tab and follow the directions. https://developer.apple.com/ios/manage/certificates/team/howto.action
To be clear, you're problem doesnt seem to be provisioning related, it's specifically the developer cert. if you do get another cert, you'll have to create all new profiles to sign your apps with.
My bundle identifier was named differently. I had to change it from Nyquist.GasBro to com.Nyquist.GasBro which is what I had in the provisioning profile.
None of previous answers helped me, so I post my issue.
Dev Center: Certificates, Identifiers & Profiles > Provisioning Profile > Distribution
Make sure that there is a distribution provisioning profile, and App ID in it is exactly the same as Bundle ID of your app in Xcode (Project Settings > General > Identity > Bundle Identifier).
Xcode: Project Settings > Build Settings > Code Signing:
Provisioning profile - choose that Distribution provisioning profile name (not Development!)
Code Signing Identity - I choosed Automatic since I have only one.
P.S. Before doing this, I deleted all unused and expired provisioning profiles and signing identities from Dev Center and from Xcode. Then, refreshed as mentioned in other answers: Xcode: Preferences > Accounts > (my Apple ID) > View Details > Refresh.
The answer that you are looking for is that when you generate the certificate request for COMMON NAME you need to put your HUMAN NAME as in John Smith, not your app name. Apple uses this term Common Name in 2 different ways and doesn't tell you that the certificate is supposed to have your name on it whereas in another area they ask for common name and want the APP name.
I had the same problem.
Nothing mentioned on this page did not work for me until i was deleted everything from archive.
After that problem disappear.
For those who says that the Ad Hoc Distribution profile wont work this year 2014, I have to agree.
In Build Settings locate the Code Signing setting: for Release choose your Store Distribution and then select Menu>Product>Archive.
Later, in the Organizer Window, select your archive and clic in Validate. It will let you select the Ad Hoc profile and validate... then select Distribute, it will let you save as .ipa file.

Resources