Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timed out waiting for UIAutomation run-loop Error while writing to fifo. #368

Closed
fancychimp opened this issue Jan 15, 2016 · 13 comments
Closed

Comments

@fancychimp
Copy link

We are seeing the following error semi-frequently, yet intermittently

Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator        version
  Background:                            # features/test.feature:4
  Calabash::Cucumber::Launcher::StartError: 

  "Timed out waiting for UIAutomation run-loop Error while writing to fifo.   RunLoop::Fifo::NoReaderConfiguredError.

  Logfile: /Users/app_name/.run-loop/results/2016-01-15_09-06-50/run_loop.out

  2016-01-15 09:06:52.021 instruments[66104:30970590] Failed to start Instruments daemon on     'Automation iPhone (9.1)' (Could not connect to the device.)
  Instruments Usage Error : Specified target process is invalid: com.Appname.iPhoneEnterprise
  • When this error occurs, I check Instruments and confirm the device is recognized as online and that the correct target (our app) is set.
  • This is not limited to 1 device, so I've ruled out device weirdness.
  • We're not running on a simulator, so the information provided by this error is odd.
  • I am seeing this in both Jenkins jobs and locally on my machine

< EDIT: the gem list was not necessary >

I can resolve this error by uninstalling and reinstalling our app, but am not sure the exact root of the issue. Please let me know if I can provide any further information.

@jmoody
Copy link
Contributor

jmoody commented Jan 19, 2016

com.Appname.iPhoneEnterprise

Is it possible that sometimes your app is signed with a distribution profile? Calabash only works with developer profiles.

We're not running on a simulator, so the information provided by this error is odd.

Yeah. It is weird. Pull requests welcome.

I can resolve this error by uninstalling and reinstalling our app, but am not sure the exact root of the issue.

Neither are we. We also struggle with this problem locally after updating the iOS version on our test devices. My strategy/checklist can be found in the Hot Topics on the wiki: FIFO.

  • restart device
  • restart Xcode
  • restart machine
  • rinse repeat

One thing that seems to work is to attach the problem device to another machine and open Xcode.

@fancychimp
Copy link
Author

Do you still experience this issue on calabash-cucumber 0.17.1?

@fancychimp
Copy link
Author

This issue persists daily for us on 0.17.1. We're looking into possible solutions.

@Edge-Man
Copy link

I'm seeing this as well with 0.17.1. going to upgrade to the latest to see if that fixes the issue....

@jmoody
Copy link
Contributor

jmoody commented Mar 21, 2016

I finally got this to pop on an iOS Simulator. This is with the @TeresaP patch for 2.0.10.pre1.

I have no steps to reproduce (yet). My CoreSimulator environment looks like it is in a good shape (no duplicate CoreSimulatorService processes).

  Calabash::Cucumber::LaunchError: 

  "Timed out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.

  Logfile: /Users/moody/.run-loop/results/2016-03-21_12-12-50/run_loop.out

          2016-03-21 12:12:56.439 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.capabilities"; channel canceled <DTXChannel: 0x7f8b04e18610>
  2016-03-21 12:12:56.439 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.device.xpccontrol"; channel canceled <DTXChannel: 0x7f8b04e13e50>
  2016-03-21 12:12:56.439 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.deviceinfo"; channel canceled <DTXChannel: 0x7f8b04e188e0>
  2016-03-21 12:12:56.439 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.processcontrol"; channel canceled <DTXChannel: 0x7f8b04e19460>
  2016-03-21 12:12:56.440 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.processcontrol.posixspawn"; channel canceled <DTXChannel: 0x7f8b04e19f10>
  2016-03-21 12:12:56.440 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.mobilenotifications"; channel canceled <DTXChannel: 0x7f8b04e1a160>
  2016-03-21 12:12:56.440 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.device.applictionListing"; channel canceled <DTXChannel: 0x7f8b0594d7e0>
  2016-03-21 12:12:56.440 instruments[42906:22555513] Connection peer refused channel request for "com.apple.dt.Xcode.WatchProcessControl"; channel canceled <DTXChannel: 0x7f8b04f31f40>
  2016-03-21 12:12:56.440 instruments[42906:22555513] Connection peer refused channel request for "com.apple.instruments.server.services.wireless"; channel canceled <DTXChannel: 0x7f8b04e1abb0>
  2016-03-21 12:12:56.442 instruments[42906:22555510] WebKit Threading Violation - initial use of WebKit from a secondary thread.
  Instruments Usage Error : Specified target process is invalid: sh.calaba.LPTestTarget
  instruments, version 7.2.1 (59503)
  usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]

@jmoody jmoody added the bug label Mar 21, 2016
@jmoody jmoody added this to the 2.1.0 milestone Mar 21, 2016
@jmoody jmoody added the FIFO label Mar 22, 2016
@jmoody jmoody changed the title Intermittent UIAutomation run-loop error Timed out waiting for UIAutomation run-loop Error while writing to fifo. Mar 22, 2016
@jmoody
Copy link
Contributor

jmoody commented Mar 23, 2016

@thechell

Can you confirm that your app is not signed with an Enterprise or Distribution certificate? It must be signed with a Developer certificate.

@jmoody
Copy link
Contributor

jmoody commented Mar 24, 2016

@TeresaP Wacky. I just discovered a very interesting edge case where run-loop thinks the app is installed on a simulator, but it is not. This might be causing this FIFO problem on simulators.

@fancychimp
Copy link
Author

@jmoody

Yes, our app is signed with a Developer certificate. The edge case you mention above is exactly what we're seeing as well. The app is not installed on a simulator, but the error indicates it thinks it is.

@TeresaP
Copy link
Contributor

TeresaP commented Mar 24, 2016

Oh interesting, @jmoody. Good catch!

@jmoody
Copy link
Contributor

jmoody commented Mar 24, 2016

@thechell

edge case

There is a misunderstanding.

In your report, you see:

Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator

That error message was fixed by: calabash/calabash-ios#1006

The edge case I mentioned today appears when targeting iOS Simulators only. Since you are running on devices, this does not apply to your situation.

When we see:

Specified target process is invalid: com.Appname.iPhoneEnterprise

it means that the:

  1. app is not installed on the device
  2. the bundle identifier is incorrect
  3. app is signed with a non-Developer cert
  4. the device does not have UIAutomation enabled
  5. the debugging symbols have not been copied from the device
  6. the device is not enabled for development and/or the device is a bad state that requires a device restart.

4, 5, and 6 usually happen after an iOS update.

This is not limited to 1 device, so I've ruled out device weirdness.

I would not rule out device weirdness.

I can resolve this error by uninstalling and reinstalling our app,

This is why I think your app is signed with a non-Developer cert. How are you deploying the app to the device?

@jmoody
Copy link
Contributor

jmoody commented Mar 24, 2016

BTW, I really appreciate your patience. This kind of problem on devices is really frustrating. It happens to me all the time after updating iOS versions - especially when I am testing betas.

If you want to convince yourself that this is a problem with Calabash and not instruments or the device, you can follow the steps in this comment.

When the problem occurs, don't reinstall the app, try following the steps in that issue comment.

@jmoody jmoody modified the milestones: 2.1.1, 2.1.0 Mar 31, 2016
@jmoody
Copy link
Contributor

jmoody commented Mar 31, 2016

Today I discussed the possibility of building some tooling with @john7doe to detect the cases where the device is in a bad state.

1. Xcode cannot copy debugging symbols (not in the waiting-to-copy state)
2. Device iOS version and active Xcode version are incompatible 
3. Any other bad state.

Number 2. we can implement from ruby: Perform an active Xcode vs. iOS version of device check and fail fast #424

1 and 3 require external tools.

I tried:

$ xcrun xcdevice --usb wait 5 <udid>
$ idevice_id -list
$ ideviceinfo --udid <udid>
$ xcrun instruments -s devices

These all reported that the device was available for case 2.

This will not be fixed for 2.1.0, but the FIFO issue for simulators will be fixed with:

ATTN: @krukow @sapieneptus

@jmoody
Copy link
Contributor

jmoody commented Apr 8, 2016

Possibly fixed by Restore UIALogger flushing and ensure variables are substituted properly. #430

@jmoody jmoody removed this from the 2.1.1 milestone Apr 16, 2016
@jmoody jmoody added the epic! label Apr 16, 2016
@jmoody jmoody closed this as completed Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants