Calabash (RunLoop::Xcrun::TimeoutError)

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
   (RunLoop::Xcrun::TimeoutError)
  ./features/ios/support/01_launch.rb:27:in `Before'

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!!!

 

 

—–UPDATE—–

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:

  1. Check UIAutomation is set to ON on the device and that you don’t have an iOS update alert on your screen
  2. 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)
  3. Unplug your device
  4. Plug it into a different computer
  5. Open Xcode and view Devices
  6. Ensure there is no yellow warning triangle, if there is then allow xcode to copy the symbol files across to your device
  7. Open Instruments and try to record a session using the device
  8. Unplug the device
  9. Restart the device
  10. Ensure the Developer row is present in settings and that UI automation is turned on
  11. Plug back into your original machine
  12. Open Xcode – check for yellow triangle and repeat symbol copying (or you might need to update xcode – xcode will tell you)
  13. Open instruments and try to record
  14. Set UIAutomation to ON again
  15. 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!!

Wget – command not found on mac – solution

I just tried to install the Nokogiri gem to scrape some content from a website (http://nokogiri.org/tutorials/installing_nokogiri.html). I followed the install instructions, but hit a problem when trying to install libiconv…basically, the nokogiri install instructions use the wget command as in :

wget http://ftp.gnu.org/pub/gnu/libicon.....

I had noticed several times before that using wget would return:

 command not found

on my mac, so this time I though I would document the alternative command [a pseudo solution] which is:

curl -O http://ftp.gnu.org/pub/gnu/libicon.....

This works fine just fine – so need to install wget- [Note that it’s an O not a zero].

Apparently wget is a free gnu package – so doing the install of wget is the true solution – it’s obtainable from here : http://www.gnu.org/software/wget/

Anyway – I’m going back to completing my nokogiri gem install. Watch for a post future about how my web content scraping adventure went.

Where are we now?

I’ve learned a fair bit about how to put a website together. I may not have finished my original project but on the way I’ve learned a lot. Interestingly, my toolset has changed dramatically – gone is Dreamweaver as my development environment and in is Coda 2 from Panic. Dreamweaver is just too cumbersome for rapidly knocking together layouts. Coda on the other hand is amazing.

Coda 2

Coda 2 – it looks beautiful and it feels so lightweight. For the finest part it is  what they call the Golden View – this means that you have the following all in one window: your html file, a preview of the page, and the css file – (admittedly easy for me with a 27 inch screen).

I use this in conjunction with Versions (a front end to Subversion) for source control. More about Versions and using Versions with Coda in the next post.

Coda also has a nifty “Preview As” feature so that you can see what you site will look like in a variety of browsers and devices – how about older versions of IE, Firefox, Opera or Safari? Also how about checking out what it will look like on an iPod Touch, or an iPhone or an iPad. Well, with Coda 2 you can, all in  click. Now talking of previewing on iPad lets discuss Diet Coda…!

Diet Coda

They also have an amazing tool called Diet Coda – this allows you to preview your site on your IPAD (in real time as you make changes on your main machine) AND it allows you to CODE on your iPad – how cool is that? Fix defects while waiting at the dentists!!! Surely this is what we have all been waiting for.

So to summarise, if you are looking for a simple and beautiful tool in which to develop your websites, I would definitely recommend Coda 2 and if you have an iPad why not add Diet Coda.

P.S. I do not work for Panic and am not affiliated with them in any way what so ever.

Which Development Environment?

I’ve been trying to find out which IDE I should use to start on my journey.

(Why does this wordpress do double line spacing?)

In my google search for IDE’s on a Mac I came across the blog of a guy called Sean Barton (http://www.sean-barton.co.uk/2009/02/setting-up-a-phpmysql-local-development-environment-on-a-mac-doing-it-properly/) and thought, that looks good, I’ll learn how to set up a php and mysql development environment on my mac. So, I followed his instructions and downloaded and installed mysql then configured apache to load the php module (I think this is the right terminology!).

The big question is, was it simple? The answer is, not as simple as I thought it would be. Below are the things that I learned along the way…they might be useful for another complete newbie.

Tip1: It’s the MySQL Community Server edition that you want to download ( I hope)

Tip 2: Make sure you use a mirror from the mysql site to get a .dmg file and not a .tar file.

Tip 3: To a copy a previous command in a Terminal window use crtl+P. For a full list of commands see this helpful bash cheat sheet

Tip 4:  How do you edit a file using vi? Answer: I”ve no idea – I used nano [to do this I substitued the word pico for the word vi when I executed this command ]

sudo vi /private/etc/apache2/httpd.conf

Tip 5: How to edit a file using nano? Answer : Wherever you see the ^ sign means hold the crtl key! – This site contains a neat crib sheet.

Tip 6: apachectl is not the same as apachrct1 – be careful of 1s and ls when looking at text which uses a terminal style font

Tip 7:  The command sudo /usr/sbin/apachectl restart doesn’t work. It errors with:

usr/sbin/apachectl:
line 82: ulimit: open files: cannot modify limit: Invalid argument

The guy at this deversus page explain a way around it, but to be honest I just ignored it and continued.

Anyway, after removing the index.html page from the /Library/WebServer/Documents folder and navigating to 127.0.0.1 in my browser and pressing refresh a few times,  I finally saw a page come up containing a question mark on it…so I guess my environment is now working!!

So, lots of new things learned today. Roll on tomorrow when I’ll be working out what I should do next!