I’ve been starting to use calabash-android, which is a way to run cucumber tests on Android. It requires Ruby Gems and Xcode Command Line Tools on Mac, which installed fine. However, when I ran the first sample test, then I noticed the app did not start. I looked at the output and saw that this error showed up:
App did not start (RuntimeError)
I looked around for the solution and did not find, so I tried a few things. It turns out to be an easy fix. In your Android app’s manifest, aka AndroidManifest.xml, include the line:
<uses-permission android:name="android.permission.INTERNET" />
inside of the manifest tag, after your application tag.
Why does this work? The reason is because Calabash-Android (and Cucumber in general) uses HTTP to communicate between the host computer and the target application. Since Android apps do not have permission to communicate via HTTP by default, the test fails to start.