Trouble with device debugging in Xcode10.3 "iPhone has denied the launch request. Internal launch error: process launch failed: Unspecified"

Trouble with device debugging in Xcode10.3 "iPhone has denied the launch request. Internal launch error: process launch failed: Unspecified"

真机调试时运行,出现如下问题

Could not launch “MY-APP-NAME” iPhone has denied the launch request.
Internal launch error: process launch failed: Unspecified

error message

Bootstrap failed with error: <NSError: 0x280617810; domain:
BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Failed to start job">
Bootstrapping failed for <FBApplicationProcess: 0x16465a240;
MY-APP-NAME; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID MY-APP-BUNDLE-ID” UserInfo={NSLocalizedDescription=Unable to bootstrap process with bundleID MY-APP-NAME, BKSProcessExitReason=0, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x28061cb40 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={NSLocalizedFailureReason=The process failed to exec, NSLocalizedRecoverySuggestion=Consult /var/log/com.apple.xpc.launchd/launchd.log for more information, 
NSLocalizedDescription=Unable to get valid task name port right for pid 635}}, BSErrorCodeDescription=bootstrap-failed}
FBSSystemService][0x1555] Error handling open request for MY-APP-NAME: <NSError: 0x281674420; domain: FBSOpenApplicationServiceErrorDomain; code: 1 (RequestDenied); reason: "The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified."> {
description = "The request to open "MY-APP-NAME" failed.";
failureReason = "The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified.";
userInfo = {
    FBSOpenApplicationRequestID = <__NSCFNumber: 0xa56f4bb69cbc0302>;
}
underlyingError = <NSError: 0x281674450; domain: FBSOpenApplicationErrorDomain; code: 1 (Unspecified)> {
    description = "The operation couldn’t be completed.
    (FBSOpenApplicationErrorDomain error 1.)";
  };
}

无论如何,我错过了一些信息...

1) 如果您还没有解锁设备,Xcode 显示 "denied"。 2)为什么 "MY-APP-NAME" ?您是否设置了应用程序名称? 3) 您使用的是纯 Swift 代码还是某种框架? 4) 你有购买开发账号吗?你用 certiifcates/provisioning 个人资料制作了所有东西吗?

无论如何,我建议创建一个普通的普通项目形式 XCode,不要写任何东西。 添加您的开发配置文件,它应该可以工作。

确保调试未设置为使用分发配置文件 - 它应该设置为开发

我通过删除所有 Xcode 相关的认证解决了这个问题。我删除了所有与 Xcode 相关的文件,目的是清除所有内容。

  1. 打开Keychain Access
  2. 删除Apple Worldwide Developer Relations Certification Authority
  3. 删除iPhone Developer: NAME (*****)
  4. 删除iOS Developer: NAME (NAME)
  5. 在Keychain Access中搜索Xcode,删除所有能看到的项(我记得这个↓)
    1. Xcode-Token
    2. Xcode-AlternateDSID
  6. 在 Keychain Access 中搜索 iOS,并删除所有可以看到的项目
  7. 在 Keychain Access 中搜索 Developer,并删除所有可以看到的项目

如果您在 签名和能力 选项卡下将团队设置为 个人团队 并且你在那里没有看到任何错误。所以只剩下一件事了。

  1. 转到您的设备设置。
  2. 导航到将军。
  3. 转到设备管理。
  4. 信任开发者应用下指定的行。

Apple 有时会升级 Developer Relations Intermediate Certificate。它可能不会在钥匙串中更新。

  1. 删除所有旧证书
  2. 获取最新证书here并安装

参考:https://developer.apple.com/support/expiration/