归档时“ Command/usr/sbin/chown 失败,退出代码1”

我正在尝试归档我的第一个 iOS 4.3 iPhone 应用程序,我总是遇到这个错误:

Command /usr/sbin/chown failed with exit code 1

我搜索了各种论坛,尝试了各种解决方案,比如改变备用安装组(我不知道该改成什么) ,打开“跳过安装”。

37999 次浏览

When I got this error, rebooting my computer fixed it.

Not sure if this is the same problem you are having, but this fixed it for me:

When I created my XCode project, my app name had a space in it, so trying to deploy my app always failed. I was able to fix this by using a Custom Archive Name.

In XCode 4...

  1. Edit the Deployment Scheme
  2. Click on the Archive tab
  3. Then specify an Archive Name that doesn't have spaces in it.

Specify a Custom Archive Name

enter image description here

I was having difficulty with the SetOwnerAndGroup part of Archiving - I was getting /usr/sbin/chown failed, and it was getting 'operation not permitted' on each file it tried to 'chown'.

This was easily tested in the terminal - 'chown' doesn't work, but 'sudo chown' does. Since I had no need to be changing file permissions, the simplest solution was to not do the chown.

The screenshot above shows - I just blanked out Install Owner/Group, and that did it.

None of the other solutions worked for me on Xcode 4.5. What I had to do was the following:

The fix is by removing the armv6 architecture from both your project and the CordovaLib project, clean both projects, and rebuild.

Source

I tried all possible variants and they didn't help me. So I downloaded old XCode 4.4.1 and voila - application archived successfully :)

I have tried all the other solutions but none of them worked for me. So I have run this on a terminal to change the owner to me on every file in my project:

sudo chown -R my_username:my_group ./my_project_folder

where "my_username" is you username, "my_group" is your group (this is usually staff) and "my_project_folder" your project's folder.

  1. Select the target that's giving you the error
  2. Change Build Active Architecture Only from Yes to No

That worked for me.

As dumb as it sounds, in XCode 5.1.1, all I had to do was quit out and restart XCode just now. I know it's not much of an "answer" but it just worked for me.

Edit: this is still working as of July 2018 for folks. Edit: this is still working as of January 2019 xcode 9.4.1

To it works in my environment I cleaned all information about permission, as +adalle said, complemented by Tom and Phil

I emptied the fields Install Group, Install Owner, Install Permission including the Cordova SubProject

When this happens to me on Xcode 8, I do "Clean build folder" 2 times (the first time it throws an error, but the second time succeeds) and then archive again.

Note: The "Clean build folder" option is under "Product" Menu, hold the alt button and you will see the "Clean" option changing to "Clean build folder".

  • Clean your project.
  • Clean your build Folder. (Product > ⌥ > Clean Build Folder)
  • Set the target device to Generic iOS Device .

enter image description here

enter image description hereI had the same issue with Xcode . It started working after restarting Xcode. In the screenshot , Xcode ->build settings , installed group was empty after restarting Xcode .the group id it has showed as some number.

For me reboot my mac fixed it. OS High Sierra, xCode 9.2