DTDeviceKit: Could not start house arrest service for app identifier XXX
Asked Answered
S

2

10

I'm using Xcode 7.3.1 and executing XCTest via the command-line on my device, "iPhone 1", which is an iPhone 6 running iOS 9.3.5:

xcodebuild \
  -scheme Todo \
  -project Todo.xcodeproj \
  -destination "platform=iOS,name=iPhone 1"\
clean build test

The build succeeded, however it failed after compiling the test files:

2016-09-13 14:51:32.604 xcodebuild[79689:2064116]  DTDeviceKit: Could not start house arrest service for app identifier com.example.Todo [Error Domain=com.apple.dtdevicekit Code=-402653093 "Too many instances of this service are already running." UserInfo={NSLocalizedFailureReason=Too many instances of this service are already running., com.apple.dtdevicekit.stacktrace=(
    0   DTDeviceKitBase                     0x000000010fead3cb DTDKCreateNSError + 113
    1   DTDeviceKitBase                     0x000000010feadb09 DTDK_AMDErrorToNSError + 791
    2   DTDeviceKitBase                     0x000000010febf2f5 __70-[DTDKRemoteDeviceConnection startHouseArrestServiceForAppIdentifier:]_block_invoke + 100
    3   DTDeviceKitBase                     0x000000010febe1d1 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_4 + 22
    4   DTDeviceKitBase                     0x000000010feb0317 __DTDKExecuteInSession_block_invoke + 38
    5   DTDeviceKitBase                     0x000000010feaf940 __DTDKExecuteWithConnection_block_invoke_2 + 477
    6   DTDeviceKitBase                     0x000000010feaf73c __DTDKExecuteWithConnection_block_invoke + 107
    7   libdispatch.dylib                   0x00007fff99bda40b _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00007fff99bdb9f2 _dispatch_barrier_sync_f_invoke + 74
    9   DVTFoundation                       0x0000000106400bef DVTDispatchBarrierSync + 206
    10  DVTFoundation                       0x00000001063dd59b -[DVTDispatchLock performLockedBlock:] + 116
    11  DTDeviceKitBase                     0x000000010feaf646 DTDKExecuteWithConnection + 223
    12  DTDeviceKitBase                     0x000000010feb02a1 DTDKExecuteInSession + 121
    13  DTDeviceKitBase                     0x000000010febe108 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 117
    14  DVTFoundation                       0x00000001063fff4b __DVTDispatchAsync_block_invoke + 827
    15  libdispatch.dylib                   0x00007fff99be593d _dispatch_call_block_and_release + 12
    16  libdispatch.dylib                   0x00007fff99bda40b _dispatch_client_callout + 8
    17  libdispatch.dylib                   0x00007fff99becbd7 _dispatch_async_redirect_invoke + 1733
    18  libdispatch.dylib                   0x00007fff99bda40b _dispatch_client_callout + 8
    19  libdispatch.dylib                   0x00007fff99bde29b _dispatch_root_queue_drain + 1890
    20  libdispatch.dylib                   0x00007fff99bddb00 _dispatch_worker_thread3 + 91
    21  libsystem_pthread.dylib             0x00007fff9b5d94de _pthread_wqthread + 1129
    22  libsystem_pthread.dylib             0x00007fff9b5d7341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Too many instances of this service are already running., NSLocalizedDescription=Too many instances of this service are already running.}]
2016-09-13 14:51:32.918 xcodebuild[79689:2063388] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

Running the tests in Xcode did not succeed either. And it always fails with the errors described in these posts:

I've tried the solutions suggested in the posts (i.e. fix provisioning profile and code signing), but it did not help. Has anyone faced similar problems?

Sos answered 13/9, 2016 at 7:43 Comment(1)
github.com/appium/appium/issues/7192Ersatz
S
7

I was trying to find out if DTDeviceKit was running on my machine, but it did not. My next suspicion was that it could be running on the phone.

After rebooting my phone, it works.

Sos answered 13/9, 2016 at 7:43 Comment(2)
too bad there isn't a way to fix this without needing to reboot the phone everytime... I hope apple is aware of the bug and is going to fix it...Integrator
Restarting the phone works for me too. Sucks that theres not a better understanding of why this happens.Menarche
I
1

I filed a technical support ticket with apple. Turns out it's a bug which affects 32 bit devices. So if you test on a 64 bit device you won't have this issue.

Integrator answered 16/2, 2017 at 3:29 Comment(5)
I just saw it in a 64-bit device. I think it just takes much longer to manifest in such devices.Ersatz
ok, best let apple know, they might try harder to fix it if that's the case :)Integrator
Maybe you can tell that to the support engineer you worked with?Ersatz
Unfortunately it was a company account so don't have access anymoreIntegrator
Happens to me on iPhone 4S and iPhone 6S that are connected to Mac Jenkins slave. It is annoying to reboot device every time this happens.Paradox

© 2022 - 2024 — McMap. All rights reserved.