0

I would like to run monkey on Jenkins but after use configuration: https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=57181910

I see in monkey.txt file:

No activities found to run, monkey aborted.

$ E:\server\AndroidSDK/platform-tools/adb.exe -s localhost:46881 shell monkey -v -v -p package.name -s 0 --throttle 0 50

$E:\server\AndroidSDK/platform-tools/adb.exe disconnect localhost:46881 [android] Stopping Android emulator [android] Archiving emulator log

I run this command on my PC, but I cannot run it on server. If I run the command: adb shell monkey -v -v 50 -p package.name -s --throttle 0 on cmd on server it will work.

How can I configure Jenkins to run monkey properly?

I'm using the newest plugins for Jenkins.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
Unii
  • 1,587
  • 15
  • 33

2 Answers2

3

Are you really using "package.name" in the monkey command line rather than your actual package name?

Did you ensure the APK was installed on the emulator before running monkey?

Otherwise, is there any output in the logcat.txt which indicates what's going wrong?

Also, I'm not sure why you linked to a really old version of the Android Emulator Plugin wiki page, but since then there's a Jenkins build step that will run monkey for you, without you having to manually write it into a batch script step.

Christopher Orr
  • 110,418
  • 27
  • 198
  • 193
  • 1
    I ran into the same issue like the reporter. My impression was that the APK kept installed after the test suite ran, but apparently this is not the case (confirmed with `shell pm list packages -f`). Luckily there is an additional "Install Android package" build step for the rescue :) – Thomas Keller May 12 '14 at 14:51
0

Like Thomas pointed out in Christopher's comment: You also have to think about installing the apk to the smartphone.

This can be done by using the "install android package" build step before "Run android monkey tester". After that you can add another build step "uninstall android package"

luckyhandler
  • 10,651
  • 3
  • 47
  • 64