# Error for ios app: Command /usr/bin/codesign failed with exit code 1

**URL:** <https://forum.ionicframework.com/t/error-for-ios-app-command-usr-bin-codesign-failed-with-exit-code-1/110162>\
**Category:** ionic-v3\
**Created:** [October 27, 2017, 7:07am UTC](https://forum.ionicframework.com/t/error-for-ios-app-command-usr-bin-codesign-failed-with-exit-code-1/110162 "2017-10-27T07:07:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IonicZb](https://avatars.discourse-cdn.com/v4/letter/i/e19b73/32.png) [@IonicZb](https://forum.ionicframework.com/u/IonicZb)\
**Post date:** [October 27, 2017, 7:07am UTC](https://forum.ionicframework.com/t/error-for-ios-app-command-usr-bin-codesign-failed-with-exit-code-1/110162/1 "2017-10-27T07:07:03Z")

</div>

I have a Ionic3 app for IoS. Until yesterday I was able to open the .xcodeproj in xcode9 and upload the app to my iphone. I have no idea what went wrong but now I get this error “Command /usr/bin/codesign failed with exit code 1” and can not upload the application to phone (using cable) or archive it.

My technologies:

**cli packages** : (/usr/local/lib/node\_modules)

```
@ionic/cli-utils : 1.15.2
ionic (Ionic CLI) : 3.15.2

```

**global packages** :

```
cordova (Cordova CLI) : 6.4.0 

```

**local packages** :

```
@ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.0.0 ios 4.3.1
Ionic Framework : ionic-angular 3.6.0

```

**System** :

```
ios-deploy : 1.9.0 
ios-sim : 6.1.2 
Node : v7.3.0
npm : 3.10.10 
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004 

```

More details about my error:

```
CodeSign /Users/macbook/Library/Developer/Xcode/DerivedData/HelloCordova-bsbygjyhdfcgftavbtgwrsqhgdkb/Build/Products/Debug-iphoneos/HelloCordova.app

cd /Users/macbook/ionic/componentaalex3/platforms/ios
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity: "iPhone Developer: Alex Claudiu (xxxxxxxxxxxx)"
Provisioning Profile: "iOS Team Provisioning Profile: *" (32d4f44b-xxxxxxxxxxxx.........................)

/usr/bin/codesign --force --sign 0E9C82C58EED8DD6B6F1DAF2709E5714F67E568B --entitlements 
/Users/macbook/Library/Developer/Xcode/DerivedData/HelloCordova-bsbygjyhdfcgftavbtgwrsqhgdkb/Build/Intermediates.noindex/HelloCordova.build/Debug-iphoneos/HelloCordova.build/HelloCordova.app.xcent --timestamp=none 
/Users/macbook/Library/Developer/Xcode/DerivedData/HelloCordova-bsbygjyhdfcgftavbtgwrsqhgdkb/Build/Products/Debug-iphoneos/HelloCordova.app

/Users/macbook/Library/Developer/Xcode/DerivedData/HelloCordova-bsbygjyhdfcgftavbtgwrsqhgdkb/Build/Products/Debug-iphoneos/HelloCordova.app: unknown error -1=ffffffffffffffff

Command /usr/bin/codesign failed with exit code 1

```

What shall I do in this situation? Do I have to make additional setup in the my Apple developer account or to change something in xcode?

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [October 27, 2017, 8:47am UTC](https://forum.ionicframework.com/t/error-for-ios-app-command-usr-bin-codesign-failed-with-exit-code-1/110162/2 "2017-10-27T08:47:50Z")

</div>

Start with upgrading these to current versions:

> [@IonicZb](#):
>
> cordova (Cordova CLI) : 6.4.0

> [@IonicZb](#):
>
> Cordova Platforms : android 6.0.0 ios 4.3.1

> [@IonicZb](#):
>
> @ionic/app-scripts : 2.1.3

---

<div class="post-metadata">

**Author:** ![IonicZb](https://avatars.discourse-cdn.com/v4/letter/i/e19b73/32.png) [@IonicZb](https://forum.ionicframework.com/u/IonicZb)\
**Post date:** [October 27, 2017, 12:08pm UTC](https://forum.ionicframework.com/t/error-for-ios-app-command-usr-bin-codesign-failed-with-exit-code-1/110162/3 "2017-10-27T12:08:35Z")

</div>

Somehow I figure it out that the problem was the Keychain access. To solve the errors I had to rewrite the password as described here [https://support.apple.com/ro-ro/HT201609](https://support.apple.com/ro-ro/HT201609)

---

<div class="post-metadata">

**Author:** ![nicks258](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nicks258](https://forum.ionicframework.com/u/nicks258)\
**Post date:** [July 26, 2018, 1:09pm UTC](https://forum.ionicframework.com/t/error-for-ios-app-command-usr-bin-codesign-failed-with-exit-code-1/110162/4 "2018-07-26T13:09:37Z")

</div>

I had the same unknown error from codesigning that you mentioned. Similar to the answer provided (but a little different), I just locked my keychain access and unlocked it, and I was able to build and run to my device again. If anyone has the same issue, perhaps try that first before going through the trouble of modifying the keychain password.
