iOS test - Failed to start Instruments daemon. The service is invalid

I am trying to run my iOS tests on a real device (iPad 8.1.2).

Unfortunately, the error I’m receiving is:

 info: [debug] And launch timeouts (in ms): {"global":90000}
2015-05-15 08:43:31:391 - info: [debug] JM waiting for exit
2015-05-15 08:43:32:034 - info: [debug] [INST STDERR] 2015-05-15 09:43:32.032 instruments[35266:3659170] Failed to start Instruments daemon on 'iPad (8.1.2)' (The service is invalid.)
2015-05-15 08:43:32:037 - info: [debug] [INST] Waiting for device to boot...
2015-05-15 08:43:32:269 - info: [debug] [INST STDERR] 2015-05-15 09:43:32.268 instruments[35266:3659166] Failed to start Instruments daemon on 'iPad (8.1.2)' (The service is invalid.)
2015-05-15 08:44:20:026 - info: [debug] [INST STDERR] Instruments Usage Error : Timed out waiting for device to boot: "iPad (8.1.2)"
2015-05-15 08:44:20:038 - info: [debug] JM proc exit
2015-05-15 08:44:20:038 - info: [debug] [INSTSERVER] Instruments exited with code 255
2015-05-15 08:44:20:038 - info: [debug] JM launchHandler
2015-05-15 08:44:20:039 - info: [debug] Killall instruments
2015-05-15 08:44:20:042 - info: [debug] JM launch error: Instruments crashed on startup
2015-05-15 08:44:20:042 - info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch

Then on Jenkins, the console log is:

DEBUG:SST:Waiting for '_has_file_been_written_to_yet'
    DEBUG:SST:Running command ['pgrep', 'ios_webkit_debug_proxy']
    DEBUG:SST:Starting command ios-webkit-debug-proxy-launcher -c a4b3b:27753
    DEBUG:SST:Waiting for '_is_process_running'
    DEBUG:SST:Starting browser (attempt: 2)
    DEBUG:SST:Device found, checking capabilities are complete
    DEBUG:SST:Updating browserName to safari
    DEBUG:SST:Running command ['pgrep', '-f', 'appium']
    DEBUG:SST:Running command ['pgrep', 'ios_webkit_debug_proxy']
    DEBUG:SST:Starting browser (attempt: 3)

I’m unsure why this is happening. Any help would be hugely appreciated. If you require further information or log reports, please just let me know.

Hi,

Could you check if device name and UDID has been correctly added to Appium arguments?

Thanks,
Sujata

Hi,

I had the same scinario and had workaround for it , found solution by just uninstall the app and install it again by ITunes…got resloved.

Hope this helps :wink:

1 Like

What do you mean by “uninstall the app”?

Do you mean uninstall Appium, XCode, Factory reset the phone?

Hi @Ben_Little ,

You just need to uninstall and install the same .app(if simulator)/.ipa (if real device) which you want to automate .

Regards,
Bhaskar.

Even I get this error but uninstalling and installing the App does not resolves the issue. I have checked UDID and it is fine. My scripts were working fine before this issue started.

Any of the following solutions may help here. But the last solution is what works for me every time.

  1. Check that the bundle id (e.g. com.crunch.crunch.iOS) is correct.
  2. Check that the UDID of the device is correct.
  3. Go to Xcode, build the app for the mobile device, and run it once.
  4. Go to Xcode->Window->devices.
    Locate your device.
    Clear console logs. (Hit the Delete button on bottom right corner).

Even I am getting similar error, please check below screenshot and advice,