Search code examples
swiftxcodeswift4

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


When real device debugging is running, the following trouble happens.

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

error message

  • Using Xcode 10.3 and Firebase Messaging Cloud.
  • After changing provisioning profile and bundle ID, this occurs.
  • This uses one year membership account and Provisioning Profile for Development.
  • When using simulator, the problem doesn’t occur.
  • Though I changed: Product > Scheme > Edit Scheme > Run > Executable to Ask On Launch, this didn’t work.
  • Unchecking Product > Scheme > Edit Scheme > Run > Debug executable didn’t work as well.
  • rm -r ~/Library/MobileDevice/Provisioning\ Profiles/. didn’t work.
  • rm -r ~/Library/Developer/CoreSimulator/Devices/. didn’t work for me as well.
  • Because it seems to be a issue of Provision Profile, I tried to fix. However, I couldn’t reach a solution.
  • When it comes to another new project, the same error has occurred.
  • The issue also occurred with another device.
  • What displays in console is below:
    • The process failed to exec
    • Unable to bootstrap process with bundleID MY-APP-NAME
    • Unable to get valid task name port right for pid 635
    • The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified.
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.)";
  };
}

Solution

  • I resolved this issue by deleting all Xcode-related certification. I deleted all Xcode-related file with the intention of clear everything.

    1. Open Keychain Access
    2. Delete Apple Worldwide Developer Relations Certification Authority
    3. Delete iPhone Developer: NAME (*****)
    4. Delete iOS Developer: NAME (NAME)
    5. Search Xcode in Keychain Access, and delete all items which can see (I remember this ↓)
      1. Xcode-Token
      2. Xcode-AlternateDSID
    6. Search iOS in Keychain Access, and delete all items which can see
    7. Search Developer in Keychain Access, and delete all items which can see