While I remember, for those of you with older macs who keep encountering the dreaded timeout error when running calabash ios against the simulator:
Xcrun timed out after 30.27 seconds executing
xcrun instruments -s templates
with a timeout of 30
You can change the default RunLoop timeout by adding a override in your support/env.rb file. For example to increase the timeout to 150 seconds, add this:
RunLoop::Xcrun::DEFAULT_OPTIONS[:timeout] = 150
Give it a try!!!
Note: RunLoop errors using calabash-ios are the most frustrating errors to debug when using physical devices. Sometimes there are other issues which cause this error, such as
A) Forgetting to put the calabash ios server in the ipa;
B) Having a typo in the one of the environment variables (BUNDLE_ID, DEVICE_TARGET, DEVICE_ENDPOINT).
C) Not having the device enabled for development
If you encounter RunLoop errors and you can’t understand why …and you are sure that it’s not one of the first 3 reasons then:
- Check UIAutomation is set to ON on the device and that you don’t have an iOS update alert on your screen
- If the Developer row is missing or UIAutomation is already turned on, try the remaining steps. If there is an IOS update alert, do the update or delete it (note it will download again and you will have the same issue unless you block apple updates in your router – if you want to do this then google it)
- Unplug your device
- Plug it into a different computer
- Open Xcode and view Devices
- Ensure there is no yellow warning triangle, if there is then allow xcode to copy the symbol files across to your device
- Open Instruments and try to record a session using the device
- Unplug the device
- Restart the device
- Ensure the Developer row is present in settings and that UI automation is turned on
- Plug back into your original machine
- Open Xcode – check for yellow triangle and repeat symbol copying (or you might need to update xcode – xcode will tell you)
- Open instruments and try to record
- Set UIAutomation to ON again
- Retry your tests.
Note that this is process that you may find yourself going through everytime you either update xcode, your device iOS version, switch machines, plug a new device into your CI…get used to going through this ritual if you are in charge of an iOS device library!!