Debugger not starting

When I build and run my App in Xcode since Xcode 8.3/iOS 10.3.1 it terminates as the debugger can't connect to the process, from iOS console (replaced

<bundle.id>
and
<AppName>
):
default
14:21:03.309592 +0100
installd
0x16dfef000 -[MIClientConnection _doInstallationForURL:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/<AppName>.app_sparse.ipa" type Developer (LSInstallType = (null)) requested by *** (pid 86)
default
14:21:03.326980 +0100
SpringBoard
com.apple.FrontBoard
Common
Successfully acquired plugin hold for <bundle.id>
default
14:21:03.391655 +0100
installd
0x16dfef000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundlePatch ID=<bundle.id>; Version=11, ShortVersion=1.3.0>
default
14:21:03.393613 +0100
installd
0x16dfef000 -[MIInstallableBundlePatch applyPatchWithError:]: Attempting patch update of <bundle.id> from 11 (1.3.0) to 11 (1.3.0)
default
14:21:03.454087 +0100
installd
0x16dfef000 -[MIInstallableBundle _refreshUUIDForContainer:withError:]: Data container for <bundle.id> is now at /private/var/mobile/Containers/Data/Application/79C1ADEE-4FB7-4C6C-A7E7-7CDF577DB842
default
14:21:03.454579 +0100
installd
0x16dfef000 -[MIContainer makeContainerLiveReplacingContainer:reason:withError:]: Made container live for <bundle.id> at /private/var/containers/Bundle/Application/8CE387B4-25FB-4843-BCB6-23940B664D17
default
14:21:03.725296 +0100
SpringBoard
com.apple.SpringBoard
Common
Installed apps did change.
Added: {(
)}
Removed: {(
)}
Modified: {(
    "<bundle.id>"
)}
default
14:21:03.726292 +0100
SpringBoard
com.apple.UserNotifications
DataProviderFactory
[<bundle.id>] Application installed using default data provider
default
14:21:05.239135 +0100
debugserver
About to launch process for bundle ID: <bundle.id>
error
14:21:05.242190 +0100
debugserver
com.apple.FrontBoard
Common
[FBSSystemService][0xb8f3] Sending request to open "<bundle.id>"
default
14:21:05.248082 +0100
SpringBoard
com.apple.FrontBoard.workspace
Common
Received trusted open application request for "<bundle.id>" from <FBProcess: 0x174af3100; debugserver; pid: 576>.
default
14:21:05.353525 +0100
SpringBoard
com.apple.FrontBoard.workspace
Transaction
Running <SBAppToAppWorkspaceTransaction: 0x106f54f90> for transition request:
<SBMainWorkspaceTransitionRequest: 0x174ce6880; eventLabel: OpenApplication(<bundle.id>)ForRequester(debugserver.576); display: Main; source: FBSystemService> {
    applicationContext = <SBWorkspaceApplicationTransitionContext: 0x174cd8bf0; background: NO> entities = {
        SBLayoutPrimaryRole = <SBWorkspaceApplication: 0x1746943c0; ID: <bundle.id>; layoutRole: primary>;
    };
}
default
14:21:05.362752 +0100
assertiond
Submitted job with label: UIKitApplication:<bundle.id>[0xf342][70]
default
14:21:05.418023 +0100
SpringBoard
[<bundle.id>] Bootstrap complete with label: UIKitApplication:<bundle.id>[0xf342][70]
error
14:21:05.423316 +0100
debugserver
com.apple.FrontBoard
Common
[FBSSystemService][0xb8f3] Request successful: <BSProcessHandle: 0x139e1ab60; <AppName>:577; valid: YES>
default
14:21:05.434504 +0100
BTServer
com.apple.bluetooth
Server.Core
Application "<bundle.id>" is now at pid 577, with state "foreground-running"
default
14:21:05.434837 +0100
mediaserverd
com.apple.coremedia
-CMSessionMgr- cmsmHandleApplicationStateChange: CMSession: Client <bundle.id> with pid '577' is now Foreground Running. Background entitlement: NO
default
14:21:05.448708 +0100
sharingd
com.apple.sharing
Daemon
SystemUI unknown identifier: '<bundle.id>'
default
14:21:05.466960 +0100
debugserver
Got a connection, launched process /private/var/containers/Bundle/Application/8CE387B4-25FB-4843-BCB6-23940B664D17/<AppName>.app (pid = 577).
default
14:21:05.539674 +0100
symptomsd
com.apple.symptomsd
proc_state
577 <bundle.id>: ForegroundRunning (most elevated: ForegroundRunning)
default
14:21:05.540172 +0100
symptomsd
com.apple.symptomsd
proc_state
Entry, display name <bundle.id> uuid 3A0150DE-0E2D-3E8C-A4D6-EEC4F87C985A pid 577 isFront 1
default
14:21:05.541160 +0100
symptomsd
com.apple.symptomsd
proc_state
Check for bundle name <bundle.id> returns 0
default
14:21:05.541336 +0100
symptomsd
com.apple.symptomsd
scoring
app name <bundle.id> isForeground 1  hasForegroundApps 1, current idea of foreground 0 disp (null)
default
14:21:05.541479 +0100
symptomsd
com.apple.symptomsd
proc_state
Continue with bundle name <bundle.id>, is front 1
default
14:21:05.541637 +0100
symptomsd
com.apple.symptomsd
proc_state
<bundle.id>: Foreground: true
default
14:21:05.542128 +0100
symptomsd
com.apple.symptomsd
proc_state
Set appCompactState object 167262 for key <bundle.id>
default
14:21:07.595021 +0100
kernel
SandboxViolation: <AppName>(577) deny(3) file-read-metadata /System/Library/Frameworks/CFNetwork.framework
default
14:21:07.782574 +0100
SpringBoard
com.apple.FrontBoard.workspace
Common
<FBApplicationProcess: 0x107c43dd0; <AppName>; pid: 577> exited voluntarily.
default
14:21:07.807371 +0100
assertiond
Deleted job with label: UIKitApplication:<bundle.id>[0xf342][70]
default
14:21:07.807701 +0100
assertiond
Submitted job with label: UIKitApplication:<bundle.id>[0x5d03][70]
default
14:21:07.808195 +0100
SpringBoard
com.apple.FrontBoard.workspace
Common
Process exited: <FBApplicationProcess: 0x107c43dd0; <AppName>; pid: -1> -> <FBApplicationProcessExitContext: 0x174629e20; exitReason: voluntary; terminationReason: (none)>
default
14:21:07.810333 +0100
assertiond
Unable to get pid for 'UIKitApplication:<bundle.id>[0x5d03][70]': No such process (3)
default
14:21:07.810645 +0100
assertiond
Failed to start job with error Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={NSLocalizedFailureReason=No such process, BKLaunchdOperation=launch_get_running_pid_4SB, BKLaunchdJobLabel=UIKitApplication:<bundle.id>[0x5d03][70], NSLocalizedDescription=Unable to get pid for label UIKitApplication:<bundle.id>[0x5d03][70]}
default
14:21:07.810747 +0100
assertiond
Deleted job with label: UIKitApplication:<bundle.id>[0x5d03][70]
default
14:21:07.829254 +0100
SpringBoard
[<bundle.id>] Bootstrap failed with error: <NSError: 0x171659140; domain: BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Failed to start job">
error
14:21:07.829500 +0100
SpringBoard
com.apple.FrontBoard.workspace
Common
Bootstrapping failed for <FBApplicationProcess: 0x107b05750; <bundle.id>; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID <bundle.id>" UserInfo={BKSProcessExitReason=1, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x17185c6e0 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={BKLaunchdOperation=launch_get_running_pid_4SB, NSLocalizedDescription=Unable to get pid for label UIKitApplication:<bundle.id>[0x5d03][70], BKLaunchdJobLabel=UIKitApplication:<bundle.id>[0x5d03][70], NSLocalizedFailureReason=No such process}}, BSErrorCodeDescription=bootstrap-failed, BKSProcessJobLabel=UIKitApplication:<bundle.id>[0x5d03][70], NSLocalizedDescription=Unable to bootstrap process with bundleID <bundle.id>}
default
14:21:07.829692 +0100
SpringBoard
com.apple.FrontBoard.workspace
Common
<FBApplicationProcess: 0x107b05750; <bundle.id>; pid: -1> exited voluntarily.
default
14:21:07.855561 +0100
BTServer
com.apple.bluetooth
Server.Core
Application "<bundle.id>" has been terminated
default
14:21:07.855940 +0100
BTServer
com.apple.bluetooth
Server.LE
Session "<bundle.id>-central-544-0" will be persisted, as it was performing long-term action(s): scanning
default
14:21:07.862037 +0100
SpringBoard
com.apple.FrontBoard.workspace
Common
Process exited: <FBApplicationProcess: 0x107b05750; <bundle.id>; pid: -1> -> <FBApplicationProcessExitContext: 0x170a3a4a0; exitReason: voluntary; terminationReason: (none)>
default
14:21:07.868958 +0100
mediaserverd
com.apple.coremedia
-CMSessionMgr- cmsmHandleApplicationStateChange: CMSession: Client <bundle.id> with pid '577' is now Terminated. Background entitlement: NO
default
14:21:07.930667 +0100
symptomsd
com.apple.symptomsd
proc_state
577 <bundle.id>: Terminated (most elevated: Terminated)
default
14:21:07.935391 +0100
symptomsd
com.apple.symptomsd
proc_state
Entry, display name <bundle.id> uuid (null) pid 577 isFront 0
default
14:21:07.935692 +0100
symptomsd
com.apple.symptomsd
proc_state
Check for bundle name <bundle.id> returns 0
default
14:21:07.935788 +0100
symptomsd
com.apple.symptomsd
scoring
app name <bundle.id> isForeground 0  hasForegroundApps 0, current idea of foreground 1 disp (null)
default
14:21:07.936002 +0100
symptomsd
com.apple.symptomsd
proc_state
Continue with bundle name <bundle.id>, is front 0
default
14:21:07.936162 +0100
symptomsd
com.apple.symptomsd
proc_state
<bundle.id>: Foreground: false
default
14:21:07.936496 +0100
symptomsd
com.apple.symptomsd
proc_state
Remove appCompactState key <bundle.id>


However, the App starts normally without the debugger and with Instruments. Starting normally and then attempting to connect the debugger gives the error 'lost connection'.

I have tried to clean, delete derived data, restart mac and iPhone, delete the App, still doesn't work.

I can see a sandbox violation in there, this is nothing I am doing. I don't know if this is causing the problem, but it doesn't occur when running the process normally.

Accepted Reply

I had the build configuration in the scheme set to Release for some reason. Changed to Debug and it works again.

Replies

I had the build configuration in the scheme set to Release for some reason. Changed to Debug and it works again.

did not help me . I still see


{NSLocalizedDescription=Unable to bootstrap process with bundleID <bundle id > BKSProcessExitReason=0, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x2869d9ec0 {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 13153}}, BSErrorCodeDescription=bootstrap-failed}

did these issue resolve ?