Nativescript-cli: iOS 13 - Could not start service com.apple.mobile.house_arrest

Created on 18 Jun 2019  路  37Comments  路  Source: NativeScript/nativescript-cli

Environment

  • MacOS: Catalina and Mojave
  • XCode: 11
  • iOS: 13
  • CLI: 5.4.1
  • Cross-platform modules: 5.4.0
  • Android Runtime: 5.4.0
  • iOS Runtime: 5.4.2
  • Plugin(s): none

Describe the bug
Creating a brand new app or an existing app produces the following error

Installing on device 00008020-000A555236900000...
Unable to apply changes on device: 00008020-000A555236900000. Error is: Could not start service com.apple.mobile.house_arrest.

To Reproduce
Create a new project, tns debug ios

Expected behavior
App to build and debug

Additional context
I can build the app fine, I can run the app through XCode fine. And it works on iOS 13 Simulators

debug ios run

Most helpful comment

@salvadorcoronel,

You are using [email protected]. See this comment #4741 (comment)

I am working on migration but an alternative that has worked in tns version v5.4.2 was...

cd $(npm config get prefix)/lib/node_modules/nativescript
npm install [email protected] [email protected]

All 37 comments

I reformatted my Mac and my iPhone with a fresh restore and no restore from backup.
I get the same problem. Here is a log trade towards the end.

Application com.minnichmfg.minnichmonitor has been uninstalled successfully.
Project dir from hooksArgs is: undefined.
Hooks directories: [ '/Users/jake/Documents/GitHub/MinnichMonitor/hooks' ]
BeforeHookName for command install is before-install
Installing /Users/jake/Documents/GitHub/MinnichMonitor/platforms/ios/build/Debug-iphoneos/MinnichMonitor.ipa on devices with identifiers: 00008020-000A55523690003A.
Received multiple results:
{ '00008020-000A55523690003A':
   [ { deviceId: '00008020-000A55523690003A',
       response: 'Successfully installed application' } ] }
Project dir from hooksArgs is: undefined.
Hooks directories: [ '/Users/jake/Documents/GitHub/MinnichMonitor/hooks' ]
AfterHookName for command install is after-install
Uploading files:
[ { source:
     '/Users/jake/Documents/GitHub/MinnichMonitor/platforms/ios/build/Debug-iphoneos/.nsbuildinfo',
    destination: 'Library/Application Support/LiveSync/.nsbuildinfo' } ]
For application com.minnichmfg.minnichmonitor on device with identifier: 00008020-000A55523690003A.
Error while executing ios device operation: Could not start service com.apple.mobile.house_arrest with code: -402653057
Unable to apply changes on device: 00008020-000A55523690003A. Error is: Could not start service com.apple.mobile.house_arrest.
Will emit event liveSyncError with data { error:
   { code: -402653057,
     deviceId: '00008020-000A55523690003A',
     message: 'Could not start service com.apple.mobile.house_arrest' },
  deviceIdentifier: '00008020-000A55523690003A',
  projectDir: '/Users/jake/Documents/GitHub/MinnichMonitor',
  applicationIdentifier: 'com.minnichmfg.minnichmonitor' }

Tested on fresh reformat and installs of Catalina and Mojave. Using iOS 13 Beta 2.

What are you waiting for? Grab that Xcode 11 beta and iOS 13 beta and get to work on the next great NativeScript app!

What is the point of the blog post https://www.nativescript.org/blog/ios-13-sign-in-with-apple-ipados-and-arkit-3-all-on-nativescript if nothing works on iOS 13? lol

Hey @JakeAi ,
Thank you for reporting this unexpected behavior. Please note that Xcode's Beta versions are not officially supported as Apple often break different things even between Beta versions.

However, we would like to investigate this case with your help. In order to have a better idea what does this error mean, I want to give a brief overview of the way NativeScript CLI works with iOS Devices.
NativeScript CLI uses several binary files coming directly from your macOS and calls their methods in order to work with the devices. Some operations, like starting application on iOS device, requires mounting a specific developer image on the device (consider this as enabling developer mode on the device). This image comes directly from Xcode and it is different for each iOS version. Whenever a new iOS is released (as it is the case with iOS 13 Beta), a new Xcode version must be used in order to get the developer image for this iOS version from it. In case there's no matching developer image, the latest available one is used. In most of the cases this leads to the error you've faced.
The way CLI looks for this image is by getting the path to Xcode from the output of xcode-select -print-path and constructs the path to the images from it.

So as a first step in our investigation, can you please execute xcode-select -print-path and ensure the printed path points to your Xcode 11 Beta instance?

@rosen-vladimirov It does, that is the only way {N} would work is if I used xcode-select --switch. And on my reformat I ONLY installed the beta.

/Applications/Xcode-beta.app/Contents/Developer

Ok, so the next step is to try restarting the device. I know it sounds weird, but in case there's already mounted incorrect image, the restart will disable it and the new run command should mount the correct one.

@rosen-vladimirov this doesn't fix the problem. I have done this multiple times.

Uninstalling com.minnichmfg.Monitor from devices with identifiers: 00008020-000A55523690003A.
Received multiple results:
{ '00008020-000A55523690003A':
   [ { deviceId: '00008020-000A55523690003A',
       response: 'Successfully uninstalled application' } ] }
Application com.minnichmfg.Monitor has been uninstalled successfully.
Project dir from hooksArgs is: undefined.
Hooks directories: [ '/Users/jake/Documents/GitHub/Monitor/hooks' ]
BeforeHookName for command install is before-install
Installing /Users/jake/Documents/GitHub/Monitor/platforms/ios/build/Debug-iphoneos/Monitor.ipa on devices with identifiers: 00008020-000A55523690003A.
Received multiple results:
{ '00008020-000A55523690003A':
   [ { deviceId: '00008020-000A55523690003A',
       response: 'Successfully installed application' } ] }
Project dir from hooksArgs is: undefined.
Hooks directories: [ '/Users/jake/Documents/GitHub/Monitor/hooks' ]
AfterHookName for command install is after-install
Uploading files:
[ { source:
     '/Users/jake/Documents/GitHub/Monitor/platforms/ios/build/Debug-iphoneos/.nsbuildinfo',
    destination: 'Library/Application Support/LiveSync/.nsbuildinfo' } ]
For application com.minnichmfg.Monitor on device with identifier: 00008020-000A55523690003A.
Error while executing ios device operation: Could not start service com.apple.mobile.house_arrest with code: -402653057
Unable to apply changes on device: 00008020-000A55523690003A. Error is: Could not start service com.apple.mobile.house_arrest.
Will emit event liveSyncError with data { error:
   { code: -402653057,
     deviceId: '00008020-000A55523690003A',
     message: 'Could not start service com.apple.mobile.house_arrest' },
  deviceIdentifier: '00008020-000A55523690003A',
  projectDir: '/Users/jake/Documents/GitHub/Monitor',
  applicationIdentifier: 'com.minnichmfg.Monitor' }
Project dir from hooksArgs is: /Users/jake/Documents/GitHub/Monitor.
Hooks directories: [ '/Users/jake/Documents/GitHub/Monitor/hooks' ]
AfterHookName for command watch is after-watch
Executing after-watch hook at location /Users/jake/Documents/GitHub/Monitor/hooks/after-watch/nativescript-dev-sass.js in-process
Validating after-watch arguments.
Executing after-watch hook at location /Users/jake/Documents/GitHub/Monitor/hooks/after-watch/nativescript-dev-typescript.js in-process
Validating after-watch arguments.
Executing after-watch hook at location /Users/jake/Documents/GitHub/Monitor/hooks/after-watch/nativescript-dev-webpack.js in-process
Validating after-watch arguments.
Stopping webpack watch for platform iOS.

Same problem

@sifex I鈥檝e yet to figure it out.

@sifex I鈥檝e yet to figure it out.

I'd say wait for Dev Beta 3 to determine whether this is an issue worth fixing

@rosen-vladimirov @sifex Beta 3 did not fix the problem.

@sifex did you figure this out? I'm still left in the dark.

@JakeAi,

We're currently working on support for iOS 13 and will write here when we have more information about this issue.

@Fatme so it's not actually supported?

@JakeAi iOS 13 is not officially released - there are a beta and a preview versions. We will support iOS 13 as soon as there is an official version released (which Apple claims should happen in the fall).

Replicates on Beta 4.

It seems to originate from a method call in IOSDeviceLib to start the com.mobile.house_arrest service.

AMDeviceStartService(devices[device_identifier].device_info, cf_service_name, &socket, NULL);

Converting the resulting error code '-402653057' to hex results in '0xe800007f' which according to this corresponds to 'Device doesn't support wireless sync'.

Tried enabling iTunes Wi-Fi sync as a possible workaround but without success, as this option does not exist anymore in Settings on iOS 13, probably because it was replaced with Finder in Catalina.

@NickIliev right. I have iOS 13 Beta on my iPhone and thought it'd be good to get the app updated to the next iOS, also referring to https://www.nativescript.org/blog/ios-13-sign-in-with-apple-ipados-and-arkit-3-all-on-nativescript

What are you waiting for? Grab that Xcode 11 beta and iOS 13 beta and get to work on the next great NativeScript app!

@sifex did you figure this out? I'm still left in the dark.

Nope, Xcode Beta 4 download didn't help either.

Replicates on Beta 4.

It seems to originate from a method call in IOSDeviceLib to start the com.mobile.house_arrest service.

AMDeviceStartService(devices[device_identifier].device_info, cf_service_name, &socket, NULL);

Converting the resulting error code '-402653057' to hex results in '0xe800007f' which according to this corresponds to 'Device doesn't support wireless sync'.

Tried enabling iTunes Wi-Fi sync as a possible workaround but without success, as this option does not exist anymore in Settings on iOS 13, probably because it was replaced with Finder in Catalina.

It'd be worth deep diving into why this is happening - regarding how debugging works between {N} run/debug and iOS, as release seems to work fine.

Both run/debug and release fail to launch the app, so possibly to do with API changes on how Xcode opens newly built apps.

@miroslavaivanova I'm still getting this with the public (non-Beta) Xcode 11 and an iPhone with iOS 13. Is the fix specific to NativeScript 6? I am using NS 5.4. Is there anything about the specific "com.apple.mobile.house_arrest" service failure that you can tell me for NS 5.4?

@yoat,

The issue is fixed in NativeScript v6.1.0. It is expected to see the error with NativeScript 5.4. You can find more information how to update to NativeScript v6.0
here.

@Fatme I am still experiencing this issue in NativeScript v6.1.2 with iOS 13 devices and Xcode 11.

If I build the project, and then launch it through Xcode, it works, but this makes the development experience very crippled, as I can't use HMR anymore.

@thomas-alrek,

Can you execute the command with --log trace and send us the output?

@Fatme Uhm, okay, so this is strange. When I run it with --log trance it actually works.

I am facing the same issue, but --log trace is not working neither. But I can build it and run via xcode

Same issue, I can't install application with tns debug ios or tns run ios

@yoat,

The issue is fixed in NativeScript v6.1.0. It is expected to see the error with NativeScript 5.4. You can find more information how to update to NativeScript v6.0
here.

Is there any plan moving forward to get this issue fixed for NS5.4, or is the fix to just move to NS6?

@jalbatross,

We don't plan to fix it for NS 5.4. The only way is updating to NS 6.1.x.

I got below error after install ios version 13.1. Nativescript vesion is 5.2.1
Error is: Could not start service com.apple.mobile.house_arrest.
Please, tell me how to fixed when someone face that error.

I get the same error on newest NS 6.1 any solutions, this issue makes developing currently quite buggy

Same issue. Error is: Could not start service com.apple.mobile.house_arrest.

MacOS: Mojave
XCode: 11.0.0
iOS: 13.1
TNS version: 5.2.4
Android Runtime: 5.4.0
iOS Runtime: 5.2.1

@Ivanepp2 see @Fatme 's comment above: NS 5.x will not be supported. We have to upgrade to NS 6.x to get on-device iOS 13 debugging re-enabled.

Same issue. Error is: Could not start service com.apple.mobile.house_arrest.

MacOS: Mojave
XCode: 11.0.0
iOS: 13.1
TNS version: 6.0.2
Android Runtime: 6.0.2
iOS Runtime: 6.0.2

Any ideas or help for solving this.

MacOS: Catalina 10.15
XCode: Release 11.1
iOS Device: 13.1.2
TNS Version: 5.4.2

Same issue: Could not start service com.apple.mobile.house_arrest with code: -402653057

Error while executing ios device operation: Could not start service com.apple.mobile.house_arrest with code: -402653057 Unable to apply changes on device: 00008020-000C1C260138002E. Error is: Could not start service com.apple.mobile.house_arrest. Will emit event liveSyncError with data { error: { code: -402653057, deviceId: '00008020-000C1C260138002E', message: 'Could not start service com.apple.mobile.house_arrest' }, deviceIdentifier: '00008020-000C1C260138002E', projectDir: '../path_project, applicationIdentifier: 'bundleId' }

@salvadorcoronel,

You are using [email protected]. See this comment https://github.com/NativeScript/nativescript-cli/issues/4741#issuecomment-534261939

@salvadorcoronel,

You are using [email protected]. See this comment #4741 (comment)

I am working on migration but an alternative that has worked in tns version v5.4.2 was...

cd $(npm config get prefix)/lib/node_modules/nativescript
npm install [email protected] [email protected]

Same issue. Error is: Could not start service com.apple.mobile.house_arrest.

MacOS: Mojave
XCode: 11.0.0
iOS: 13.1
TNS version: 5.2.4
Android Runtime: 5.4.0
iOS Runtime: 5.2.1

@rkeller1 @Ivanepp2
try this alternative to tns 5.x See this comment: https://github.com/NativeScript/nativescript-cli/issues/4741#issuecomment-546234733

This fixes the "Could not start service com.apple.mobile.house_arrest" problem:

  1. Connect your device to your mac
  2. Open your iOS workspace in xcode
  3. Make sure your device is selected as the target platform and run the project from there (Xcode>Product>Run).
Was this page helpful?
0 / 5 - 0 ratings