49

I've tried to install my app on several iOS devices. But this thing didn't let me to.

enter image description here

I want to know, what the problem is and how should I solve it.

Robert Khaireev
  • 739
  • 1
  • 7
  • 13

11 Answers11

93

In my case, the problem was unsigned frameworks.

Xcode 11 or above:

Go to Build Phases, expand Embedded Frameworks and select all Code Sign on Copy checkboxes.

Xcode 10 or earlier:

Build Phases > Copy Files > Code Sign on Copy (select all checkboxes)

Code Sign on Copy selected in every row

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
derevo
  • 9,048
  • 2
  • 22
  • 19
26

I had this problem, this is what I did to resolve it:

  • Run "clean" in Xcode
  • Close Xcode
  • Remove all data in ~/Library/Developer/Xcode/DerivedData
  • Remove all xcuserdata folders in your project (check in your xcodeproj and project.xcworkspace directories)

Only if you have Cocoapods in your project:

  • Run pod deintegrate.
  • Remove your .xcworkspace if it was created by CocoaPods.
  • Run pod install or pod update

Now you can open your fresh Xcode.

Hope this help you.

In my case the problem was created by adding a new cocoa touch framework.

Bob Gilmore
  • 12,608
  • 13
  • 46
  • 53
ucotta
  • 557
  • 4
  • 7
20

If "code sign on copy" fails, then check if you are modifying the frameworks in a run script after the "Embed Frameworks" phase.

If you are, then move the Run script to a position before the "Embed Frameworks" phase.

Kunal Gupta
  • 2,984
  • 31
  • 34
rockdaswift
  • 9,613
  • 5
  • 40
  • 46
12

In my case, I have created an unsigned IPA file and for this i had made some changes in SDKSetting.plist file (changed CODE_SIGNING_REQUIRED = NO) and it should be always YES if you are running application on the device.

To resolve this follow the below steps: Steps to create unsigned IPA (Tested on Xcode 9.4.1)

Step 1: Open finder > Go to Folder.. as below screen

enter image description here

and then copy and past the below line:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.*.sdk/SDKSettings.plist

Open iPhoneOS.sdk as showing in below image: enter image description here

Step 2: Copy the SDKSettings plist in another folder because you can't make changes here:

Step 3: Make the change in duplicate

set CODE_SIGNING_REQUIRED to YES enter image description here

Step 4: Now replace duplicate Plist with the original one (Both names must be the same). This will also ask admin permission to change.

********************************OR**************************************

If you will update your Xcode then the problem will also disappear because updated xcode will come with default SDKSetting.plist

Alok
  • 24,880
  • 6
  • 40
  • 67
  • My first question is why it would even turn into NO. This has to be YES all the time. I know why in my system it was NO because I installed iOSOpenDev Installer. This doesnt fix the issue. – Alok C Sep 13 '18 at 18:20
  • @Alix in my case, I had created an unsigned IPA file that's why tuned to NO. – Alok Sep 14 '18 at 03:39
  • I see but then later part of the post is wrong where you said "If you will update your Xcode then the problem will also disappear because updated xcode will come with default SDKSetting.plist". Code Signing Required is by default is YES – Alok C Sep 15 '18 at 07:46
  • @Alix second point is also correct, I had updated my code to newer available version and it became automatically YES from NO. Because you you will update your xcode the plist comes with default setting and by default it’s always YES. – Alok Sep 15 '18 at 07:50
  • Same problem here, I forgot I did modified SDKSetting.plist to create an unsigned IPA. Reverting AD_HOC_CODE_SIGNING_ALLOWED to NO and restarting XCode got rid of the error message – Dan Apr 30 '19 at 08:39
2

I also faced same issue. I tried all above solution none work from me.

Below stuff worked for me,

  1. Select Build settings
  2. Locate "Code Signing identity"
  3. select "IOS Developer" or any other correct option for all.

Then build and run.

Avaan
  • 4,709
  • 1
  • 10
  • 13
1

Folks, My problem's Root cause was modifications that were done by iOSOpenDev installer. I did restore the original plist file that was backed up by the installer. that solved my problem you need to look into the SDK directory to see if something funky has happened. at least one more option to try.

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS<SDK version>.sdk/

example:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/

by default code signing must be turned on, if that is turned off then something funky happened. (for ref See Alok's answer below)
If nothing works. My recommendation would be to delete and reinstall Xcode as this error would not arise in the normal scenarios. So resetting Xcode can greatly reduce troubleshooting time.

Alok C
  • 2,787
  • 3
  • 25
  • 44
0

1) Try to clean project 2) Try to relaunch XCode 3) Reset your mac

Alexander B
  • 137
  • 2
  • 12
  • I had this situation and I had to restart my iPhone and then it works. Do you have developer accounts or not? If not check this out http://stackoverflow.com/questions/4952820/test-ios-app-on-device-without-apple-developer-program-or-jailbreak – PiterPan Jul 14 '16 at 10:03
  • 3
    nope, didn't work for me – Robert Khaireev Jul 14 '16 at 10:08
0

Restarting my device fixed the problem

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
manncito
  • 3,814
  • 1
  • 17
  • 16
0

I have some issues during App upload to the Appstore then i Add Some Code in Build Phase -> Run Script

done I clean Build folder and remove t above code from Run Script And Build again and run on my Iphone it work fine

You can remove the code of run script or check the check box of ."Run script only when installing " then also it will work

M Murteza
  • 1,629
  • 15
  • 10
0

Enabling "Automatically manage signing" solved the issue for me. (In the target settings, "General" tab, section "Signing")

Theo
  • 3,826
  • 30
  • 59
-4

It is clear you do not have the developer and the distribution profile set for the devices you are trying to install the app.

Amruta
  • 56
  • 3
  • I have developer key and have same error, actually it comes after success build, in script executing part. – derevo Sep 20 '16 at 20:04
  • There are many things that could cause this, not just the dev/dist profile for the devices. Such as code signing for third party frameworks. – David Karasek Mar 23 '17 at 13:25