Search code examples
rubycucumbercalabash-android

Error while using ruby cucumber and calabash?


/usr/bin/ruby -EUTF-8 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /usr/bin/cucumber /Users/aalra01/RubymineProjects/wendys-android/Wendys/features/menu/menu.feature --format Teamcity::Cucumber::Formatter --expand --name "^The menu items are separated into their respective categories$" --color -r features Testing started at 10:15 AM ... Given I am on the menu # features/step_definitions/menu/menu.rb:18 When I select the category # features/step_definitions/menu/menu.rb:24 Then I am taken to the section # features/step_definitions/menu/menu.rb:34 2102 KB/s (560131 bytes in 0.260s) 2167 KB/s (9053374 bytes in 4.079s) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2814, uid=2814 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2831, uid=2831 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2848, uid=2848 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2865, uid=2865 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2881, uid=2881 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2899, uid=2899 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2916, uid=2916 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2933, uid=2933 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.wendys.wendys.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner} from pid=2983, uid=2983 not allowed because package com.wendys.wendys.test does not have a signature matching the target com.wendys.wendys at android.os.Parcel.readException(Parcel.java:1540) at android.os.Parcel.readException(Parcel.java:1493) at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:3609) at com.android.commands.am.Am.runInstrument(Am.java:950) at com.android.commands.am.Am.onRun(Am.java:316) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:99) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected: Connection reset by peer ./features/support/screen_object/element_definers.rb:4:in block in element' ./features/support/screen_object/element_definers.rb:35:inblock in button' ./features/step_definitions/menu/menu.rb:21:in /^I am on the menu$/' ./features/menu/menu.feature:10:inGiven I am on the menu' Skipped step Skipped stepCould not take screenshot com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:648) at com.android.ddmlib.AdbHelper.read(AdbHelper.java:616) at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:296) at com.android.ddmlib.CalabashAdbHelper.getFrameBuffer(Unknown Source) at com.android.ddmlib.CalabashDevice.getScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.takeScreenshot(Unknown Source) at sh.calaba.screenshot.ScreenshotTaker.main(Unknown Source) 9 scenarios (9 failed) 27 steps (9 failed, 18 skipped) 3m33.125s Process finished with exit code 1


Solution

  • The error Permission Denial: starting instrumentation Component means that you don't have the right debug key. If you have the keystore and it was working before then check that the keystore hasn't been updated. If you don't have the keystore you can resign the app with your own.

    calabash-android resign app.apk
    

    From - https://github.com/calabash/calabash-android/wiki/Running-Calabash-Android

    The apk calabash android runs must be signed with the same keystore as the test-server.

    Use the command: calabash-android resign to resign your application.

    Building the test-server using calabash-android build will build the test-server and sign it with the same key as the application you are testing.

    If debug.keystore is missing, it be recreated with the following command:

    keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"