Code signing is required for product type Unit Test Bundle in SDK iOS 8.0

IosObjective CXcode

Ios Problem Overview


Getting

> Code signing is required for product type 'Unit Test Bundle' in SDK > 'iOS 8.0'

My app target is code signing just fine - but my test target is not. I bought a new computer, created a new development certificate from the computer, updated the provisioning profile accordingly, installed both, but can't get past this code signing error.

Any way of wiping all certs/profiles locally so I can reinstall?

Probably some kind of bug.

Ios Solutions


Solution 1 - Ios

The problem is the project is under source control and every time I pull the .xcodeproj is updated. And since my provisioning profile is different than the one in source control, the Unit Test target automatically switches to "Do not code sign". So I simply have to set the profile there after each git pull.

Apparently if deploying to a device, if there is a unit test target, it must be code signed.

Steps:

  1. Change target to your test target (AppnameTests)

enter image description here

  1. Make sure "Code Signing Identity" is NOT "Don't Code Sign". Pick a profile to sign with

enter image description here

That is all I had to change to get it to work.

Solution 2 - Ios

I fixed the issue (temporarily) by going to Edit Scheme, then in the Build section, removing my unit test target from being invoked in "Run".

Solution 3 - Ios

The other advice here didn't help me, but I fixed this error by going to Product > Scheme > Edit Scheme. Then I clicked Build on the left hand side and deselected any checkboxes next to AppNameTests. I'm using XCode 6.3

enter image description here

Solution 4 - Ios

I fixed it by manually selecting a provisioning profile in the build settings for the test target.

Test target settings -> Build settings -> Code signing -> Code sign identity. Previously, it was set to "Don't code sign".

Solution 5 - Ios

Also, if you set your build target device, the problem will go away when you testing and debugging. The code signed is only need when you trying to deploy your app to an actually physical device fig

I changed mine from "myIphone" to simulator iPhone 6 Plus, and it solves the problem while I'm developing the app.

Solution 6 - Ios

In my case the problem that I faced was:

> CodeSign error: code signing is required for product type 'Unit Test > Bundle' in SDK 'iOS 8.4'

Fortunatelly, the target did not implemented anything, so a quick solution is remove it.

enter image description here

Solution 7 - Ios

If nothing works from above solutions follow these steps

From Targets select appnameTests Under "Info"

Change following > Bundle Identifier: com.ProjectName.$(PRODUCT_NAME:rfc1034identifier) > > to com.ProjectName.appname > > Bundle name: $(PRODUCT_NAME) > > Bundle name: appname

Compile & execute

Solution 8 - Ios

I was getting this error when running xcodebuild from commandline for integration tests on my work's CI. I managed to get it working by setting the project level setting to codesign. For some reason the target setting was being ignored and it reverted to the project's setting.

Solution 9 - Ios

I solve the problem by changing the 'Provisioning Profile' in the same section ('Code Signing') from Automatic to 'MyProvisioningProfile name'

Solution 10 - Ios

Hi I face the same problem today. After reading "Spentak"'s answer i tried to make code signing of my target to set to iOSDeveloper, and still did not work. But after i changing "Provisioning Profile" to "Automatic", the project got built and ran without any code signing errors.

Solution 11 - Ios

Sometimes this happens when you download a project from github or other third party tutorial sites.These apps are usually signed with a different identity or company/name.When this happens,if you can't solve the solution,simply create a new xcode project and copy all the header and implementation files into your new project.Also don't forget the dependency files..such as the framework files.This works for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSpentakView Question on Stackoverflow
Solution 1 - IosSpentakView Answer on Stackoverflow
Solution 2 - IosZ SView Answer on Stackoverflow
Solution 3 - IosOlivia StorkView Answer on Stackoverflow
Solution 4 - IosFrostView Answer on Stackoverflow
Solution 5 - IosIan ZhaoView Answer on Stackoverflow
Solution 6 - IosJavier Calatrava LlaveríaView Answer on Stackoverflow
Solution 7 - Iosnirvana74vView Answer on Stackoverflow
Solution 8 - IosPelletView Answer on Stackoverflow
Solution 9 - IosarniotakiView Answer on Stackoverflow
Solution 10 - IosSahan MaldeniyaView Answer on Stackoverflow
Solution 11 - IosBrainyMonkeyView Answer on Stackoverflow