Jenkins can’t find android device

Sometimes, we see the problem where the jenkins is no longer listing the android device when trying to run our automated tests.

We try adb devices and there is nothing coming back. We unplug and replug and nothing happens.

Well…I worked out what was causing so this so that I no longer see it…and I’ll tell you about that later, but in order to get things running again, here’s what you generally need to do.

You need to kill and restart the adb as root on the jenkins server and THEN you need to unplug and replug the device(s). Do the following (on an ubuntu server)

sudo su
enter password
cd Android/Sdk/platform-tools/
./adb kill-server 
./adb start-server 
./adb devices 
exit

So, what’s causing this? Generally it’s two calabash jobs running at the same time that causes adb to get confused as hell. To prevent this either build a rake task or install a build blocker plug-in.

Advertisements

Cucumber error – invalid byte sequence in UTF-8 (ArgumentError)

Ever get an invalid byte sequence in UTF-8 (ArgumentError) when trying to run your calabash-android project?
Here’s a thing to check – have you got 2 apks in your apk folder / prebuilt folder?
That’s usually the cause.

 

Hope that helps someone out there save 30 minutes trying to work out why your test isn’t running.

Searching cucumber feature files by tag

You know when you’re working on project and you end up with hundreds of cucumber feature files and your working environment doesn’t use JIRA very well and you just have all these feature files not linked to anything to help you determine the status of them…even though you’ve tagged them all nicely?…And you think to yourself, all I want to be able to do is to find all the feature files that I have tagged as @to_do so that I can work through them. Or someone wants a list of all the feature files where the scenarios are tagged @manual? Or you want to see what feature files you have tagged for @android_only or for @ios_only…and so on.

Well, since you’re in an environment which does’t want you messing up JIRA with all your test stuff!!??!!!???? …then you have to take control yourself…so what’s the answer here?

Update: The answer is to create the utility yourself!!
See this post..get files listed by tagname