ios 每次编译到设备时,Xcode 都会询问用户名和密码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9738298/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 17:21:56  来源:igfitidea点击:

Xcode asking username & password every time I compile to device

iosxcodemacosdebuggingosx-lion

提问by edwinjomathew

I use an admin account for the development. But every time I compile to a device Xcode is asking for admin username & password. I googled the issue. But none of the solutions worked. I tried the workarounds from this post, but it didn't work

我使用管理员帐户进行开发。但是每次我编译到设备上时,Xcode 都会要求输入管理员用户名和密码。我用谷歌搜索了这个问题。但没有一个解决方案奏效。我尝试了这篇文章中的解决方法,但没有奏效

Authorize a non-admin developer in Xcode / Mac OS

在 Xcode / Mac OS 中授权非管理员开发人员

I also tried disabling and enabling the DevSecurityTools but it didn't work. I am using Xcode 4.3.1 installed on Mac OSX Lion 10.7.3.

我还尝试禁用和启用 DevSecurityTools,但没有奏效。我正在使用安装在 Mac OSX Lion 10.7.3 上的 Xcode 4.3.1。

Is there any way to fix this?

有没有什么办法解决这一问题?

回答by Brijesh Vadukia

For solution go to Keychain Access, and in the top left navigation, move your Developer certificate from "System" to "Login".

如需解决方案,请转到钥匙串访问,然后在左上角导航中,将您的开发人员证书从“系统”移至“登录”。

Actually problem is Developer certificate is under "System", and it is locked every-time, so it will require a password to unlock, whereas when certificate is in "Login" section it will resolve that.

实际上问题是开发人员证书在“系统”下,并且每次都被锁定,因此需要密码才能解锁,而当证书在“登录”部分时,它将解决该问题。

回答by NaXir

In keychain remove your development and distribution certificates from Systemand place them under Login. It will ask once and you have to select Always allow

在钥匙串中,从System 中删除您的开发和分发证书,并将它们放在Login下。它会询问一次,您必须选择始终允许

That worked for me. Hope it works for you aswel.

那对我有用。希望它对你有用。

回答by Anni S

In Xcode 7.1, I didn't find Loginso I have given access to Xcodeand codesignfor the certificate key by following steps:

Xcode 7.1,我没有找到登录,所以我给了访问Xcode,并codesign通过以下步骤证书密钥:

  1. Open Key Chain
  2. Go to Certificate under System
  3. Click on closure, right click on private key and select 'Get Info'
  4. Click on 'Access Control' tab
  5. Add Xcodeand codingunder 'Always allow access by these applications:'
  1. 打开钥匙链
  2. 转到系统下的证书
  3. 单击关闭,右键单击私钥并选择“获取信息”
  4. 单击“访问控制”选项卡
  5. 添加Xcodecoding下“总是允许通过这些应用程序的访问:

It solves my problem.

它解决了我的问题。

回答by user1466837

Is the /Developers directory from the old Xcode still on the drive? I just had a user with this issue that was also experiencing build fails with code that other users were able to build successfully. Some of the file associations cause the new Xcode (moved to the /Applications folder) to reference components in the old /Developers folder. Once we removed the folder and emptied the trash, everything worked as expected.

旧 Xcode 中的 /Developers 目录是否仍在驱动器上?我刚刚有一个用户遇到了这个问题,他也遇到了其他用户能够成功构建的代码的构建失败。某些文件关联会导致新 Xcode(移至 /Applications 文件夹)引用旧 /Developers 文件夹中的组件。一旦我们删除了文件夹并清空了垃圾箱,一切都会按预期进行。

回答by GameBegins

After moving Developers certificate form "System" to "Login". If it still asks for Username and password, you need to check your code signing. Go to the Build Setting and under code signing select the respected developer's certificate. It works for me.

将开发人员证书表格“系统”移至“登录”后。如果它仍然要求输入用户名和密码,您需要检查您的代码签名。转到构建设置并在代码签名下选择受尊重的开发人员证书。这个对我有用。