[android-developers] MonkeyRunner -- Download and install apk automatically
hi, Hope all doing well. I am using monkeyrunner for automation of one set up. I have one test case where i need to download the apk from the emulator browser for the configured url and then install that apk. After installing the apk, launch it. I know using monkeyrunner we can install and launch the app. Can somebody guide me on opening the emulator browser using configured url (in some file ) and then install the apk on the emulator using monkeyrunner. Thanks regards, Bunty Sayyad -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] monkeyrunner broken pipe exception
My device is HTC butterfly In Android 4.1, it never happen, but Android 4.3 sometime will happen. I run the same monkeyrunner script, sometime it has broken pipe exception, but sometime not. How can I fix this issue ? Or this is HTC or Android 4.3 issue ? The detail log: 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] Error sending drag start event 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]java.net.SocketException: Broken pipe 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.net.SocketOutputStream.socketWrite0(Native Method) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.net.SocketOutputStream.write(SocketOutputStream.java:136) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.io.BufferedWriter.flush(BufferedWriter.java:236) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.ChimpManager.sendMonkeyEventAndGetResponse(ChimpManager.java:187) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.ChimpManager.sendMonkeyEvent(ChimpManager.java:235) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.ChimpManager.touchDown(ChimpManager.java:88) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.adb.AdbChimpDevice$2.start(AdbChimpDevice.java:575) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.adb.LinearInterpolator.interpolate(LinearInterpolator.java:118) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.chimpchat.adb.AdbChimpDevice.drag(AdbChimpDevice.java:556) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.android.monkeyrunner.MonkeyDevice.drag(MonkeyDevice.java:174) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.lang.reflect.Method.invoke(Method.java:597) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186) 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.python.core.PyObject.__call__(PyObject.java:345) 140630 11:27:11.088:S -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] MonkeyRunner fails on waitForConnection
Hi, I'm trying to implement some tests using MonkeyRunner. I run the following code and the start the emulator: #!/usr/bin/python import sys from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice print (waiting for: + sys.argv[1]) device = MonkeyRunner.waitForConnection(10,emulator-5580) print (waiting ended) if (device is not None): MonkeyRunner.sleep(30) print (device closing) device.shell(stop) print (device closed) else: print (device not detected) But, as soon it connects, it always launch a NullPointerException. Before that I get the following warning: [main] [com.android.chimpchat.adb.AdbChimpDevice] Timeout while trying to create chimp mananger I've tried using a clean SDK and new virtual devices so I think it must be something on my system: gentoo 3.0.35-tuxonice x86_64 If anybody knows what can I do to make it work I'll be very grateful. Regards -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner with jython -i (interactive) switch
Can I get the equivalent of jython -i foo.py for monkeyrunner? Something like ./monkeyrunner -i set_up_phone.py ... ... creates MonkeyDevice d sets up d just so d.do_stuff_through_the_interactive_prompt() -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Monkeyrunner not capturing screenshot correctly
everything was working perfectly fine weeks ago, the screenshot was perfect. but this week, However the screenshot often end up being black or not captured correctly e.g. only part of the screen is captured or it has a partial overlay of the previous screen. Is there a way of stopping this from happening? I initially thought it was because the app wasn't loading quick enough or it was taking some time to save the screenshot to memory or write to disk so I've put delays in between the steps but the images still come out corrupted. Help on solving this problem would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner touch event never returns
I didn't find any topic that seemed to address this specific problem, so here goes. I have a monkeyrunner script that does a series of touch() and drag() calls that run in a loop. The script tests the same sequence many times over for stability purposes. The problem that I see is that the script will stall unexpectedly at different places in the sequence. Sometimes it runs a few times, sometimes dozens, but it eventually stops. It never gives any kind of error output, just stops as if the PC-side script is waiting forever for the touch to complete. It's never the same touch coordinates, so it seems to me there's some kind of problem on the phone side where the MonkeyStub just never returns to the script. My phone is NexusS4G running Android 4.0.4. I posted a representative logcat output below with an annotation of where the script stalled. I don't see anything else interesting happening on the phone at the time, so the problem seems internal to MonkeyStub to me. Does anyone have any ideas what I can do? Any more debug info I can/should collect? Any general advice about using monkeyrunner gently? Fr what it's worth, the same script on the same phone had no problems when it ran GB before upgrading to ICS. 08-24 03:16:33.985: D/AudioHardware(97): AudioHardware pcm playback is exiting standby. 08-24 03:16:33.985: D/AudioHardware(97): openPcmOut_l() mPcmOpenCnt: 0 08-24 03:16:34.956: D/MonkeyStub(22729): translateCommand: tap 520 300 08-24 03:16:35.964: D/MonkeyStub(22729): translateCommand: tap 550 450 08-24 03:16:36.971: D/MonkeyStub(22729): translateCommand: tap 350 350 08-24 03:16:37.119: D/AudioHardware(97): AudioHardware pcm playback is going to standby. 08-24 03:16:37.119: D/AudioHardware(97): closePcmOut_l() mPcmOpenCnt: 1 08-24 03:16:37.977: D/MonkeyStub(22729): translateCommand: tap 550 450 08-24 03:16:38.283: D/dalvikvm(236): GC_CONCURRENT freed 1074K, 25% free 12643K/16839K, paused 3ms+8ms 08-24 03:16:38.983: D/MonkeyStub(22729): translateCommand: tap 350 350 *** last MonkeyStub entry *** 08-24 03:18:45.435: D/dalvikvm(236): GC_CONCURRENT freed 1071K, 25% free 12647K/16839K, paused 2ms+6ms 08-24 03:19:12.758: D/dalvikvm(166): GC_CONCURRENT freed 1974K, 26% free 18904K/25287K, paused 4ms+18ms 08-24 03:20:13.544: D/dalvikvm(633): GC_CONCURRENT freed 351K, 12% free 9901K/11143K, paused 13ms+9ms 08-24 03:20:54.620: D/dalvikvm(236): GC_CONCURRENT freed 1087K, 25% free 12643K/16839K, paused 2ms+5ms 08-24 03:21:28.627: D/dalvikvm(1062): GC_CONCURRENT freed 417K, 6% free 9773K/10375K, paused 5ms+12ms 08-24 03:22:18.774: D/dalvikvm(166): GC_CONCURRENT freed 1945K, 26% free 18884K/25287K, paused 3ms+20ms -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner device.type() dropping characters
trying to learn how to write monkeyrunner scripts in python: device.startActivity( component='com.android.calculator2/.Calculator' ) time.sleep(1) device.type( '2*3=' ) starts the calculator, accepts the input and displays the proper result. However device.startActivity( component='com.android.browser/.BrowserActivity', uri='http://www.amazon.com' ) time.sleep(5) device.type('www.yahoo.com') device.press('KEYCODE_ENTER', 'DOWN_AND_UP') starts the browser with www.amazon.com just fine, but then the first two 'w' from www.yahoo.com get dropped. I've tried varying the sleep time and also sending each individual character one device.press() at a time, but trying to send keystrokes to the browser always results in leading characters getting dropped. What am I missing? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner device.type() dropping characters
trying to write a simple demo monkeyrunner python script device.startActivity( component='com.android.calculator2/.Calculator' ) time.sleep(1) device.type( '2*3=' ) this works as I expect, starts the calculator and it displays the correct result, having some difficulty with the browser. I can start it with a given url device.startActivity( component='com.android.browser/.BrowserActivity', uri='http://www.amazon.com' ) but if I try to send a url after the browser starts with device.type() leading characters are getting dropped: device.startActivity( component='com.android.browser/.BrowserActivity' ) time.sleep(5) device.press('KEYCODE_ENTER', 'DOWN_AND_UP') device.type('www.yahoo.com') device.press('KEYCODE_ENTER', 'DOWN_AND_UP') logcat shows the correct string, but the first two 'w' are dropped when the string is reported by the SearchDialog. Any idea what is causing the dropped characters? logcat ( minus dalvik msgs) I/ActivityManager( 61): Start proc com.android.browser for activity com.android.browser/.BrowserActivity: pid=1421 uid=10033 gids={3003, 1015} I/ActivityThread( 1421): Pub browser: com.android.browser.BrowserProvider I/BrowserSettings( 1421): Selected search engine: ActivitySearchEngine{android.app.SearchableInfo@405998b0} I/ActivityManager( 61): Displayed com.android.browser/.BrowserActivity: +1s524ms D/MonkeyStub( 1404): translateCommand: press KEYCODE_ENTER W/KeyCharacterMap( 1421): No keyboard for id 0 W/KeyCharacterMap( 1421): Using default keymap: /system/usr/keychars/ qwerty.kcm.bin D/MonkeyStub( 1404): translateCommand: type www.yahoo.com W/KeyCharacterMap( 1404): No keyboard for id 0 W/KeyCharacterMap( 1404): Using default keymap: /system/usr/keychars/ qwerty.kcm.bin W/KeyCharacterMap( 1421): No keyboard for id 0 W/KeyCharacterMap( 1421): Using default keymap: /system/usr/keychars/ qwerty.kcm.bin W/KeyCharacterMap( 1421): No keyboard for id 0 W/KeyCharacterMap( 1421): Using default keymap: /system/usr/keychars/ qwerty.kcm.bin D/MonkeyStub( 1404): translateCommand: press KEYCODE_ENTER D/MonkeyStub( 1404): Quit requested D/SearchDialog( 1421): launching Intent { act=android.intent.action.SEARCH flg=0x1000 cmp=com.android.browser/.BrowserActivity (has extras) } I/SearchDialog( 1421): Starting (as ourselves) #Intent;action=android.intent.action.SEARCH;launchFlags=0x1000;component=com.android.browser/.BrowserActivity;S.query=w.yahoo.com;S.user_query=w.yahoo.com;end I/ActivityManager( 61): Starting: Intent { act=android.intent.action.SEARCH flg=0x1000 cmp=com.android.browser/.BrowserActivity (has extras) } from pid 1421 V/webkit ( 1421): guessURL before queueRequest: w.yahoo.com W/SuggestionsAdapter( 1421): Tried to change cursor after adapter was closed. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner
I am working on making some changes to the android framework layer and building my own version. I am working based on froyo and trying to use monkeyrunner for some testing. I have pulled the source and can build and run in the emulator but when I try to use a monkeyrunner script I can't seem to get anyhting to work. I built the code using lunch full- eng and it runs fine on the device. I am just trying to get a simple script running based on the example at http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html shown below with a print statement added just to see if I could get anything to run. # Imports the monkeyrunner modules used by this program from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice # Connects to the current device, returning a MonkeyDevice object device = MonkeyRunner.waitForConnection() print Hello World! When the following line is in the script I get an error as follows. from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice Traceback (most recent call last): File ../../MRTesting/MyTest.py, line 4, in module from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice ImportError: cannot import name MonkeyDevice So if I remove MonkeyDevice from the import as shown below I get a different error on the call to waitForConnection() from com.android.monkeyrunner import MonkeyRunner Traceback (most recent call last): File ../../MRTesting/MyTest.py, line 6, in module device = MonkeyRunner.waitForConnection() AttributeError: type object 'com.android.monkeyrunner.MonkeyRunner' has no attribute 'waitForConnection' I tried modifying the call to have some arguments as indicated in the documentation as follows but I still get the same error. The second argument matches the value returned by a call to adb devices. device = MonkeyRunner.waitForConnection(5, 'emulator-5554') I have done some digging around and one person said that the shebang needs to be at the beginning of the file as follows with the path modified to avoid putting information in I would rather not share. #! /home/path/monkeyrunner I could not see how this would be any different than me invoking monkeyrunner directly from the command line but I tried it and no luck. I did not install the sdk anywhere on my system as it is included in the build tree but it seems to me that the monkeyrunner tool might not be able to locate it as needed but I can't find any indication of how to fix this. I am running the following commands when I build my system from within my build directory at the root. . build/envsetup.sh setpaths lunch full-eng make -j16 Anyone have any thoughts on this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Monkeyrunner
Hi, Apk and its Package name itself is enough to start the testing on the app through monkey runner.. Regards, Chandra -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Monkeyrunner doesn't work after icecream sandwich update
I've just installed the latest Android tools, platform tools and platform. If I try to run monkeyrunner in a terminal I get the following exception: Exception in thread main java.lang.NoClassDefFoundError: com/android/chimpchat/ChimpChat at com.android.monkeyrunner.MonkeyRunnerStarter.init(MonkeyRunnerStarter.java:60) at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:188) Caused by: java.lang.ClassNotFoundException: com.android.chimpchat.ChimpChat at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 2 more Does anyone know how to fix this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Monkeyrunner doesn't work after icecream sandwich update
Odd. monkeyrunner.jar does not have com.android.chimpchat in it. On Wed, Oct 19, 2011 at 11:38 AM, kaciula catalin.moro...@gmail.com wrote: I've just installed the latest Android tools, platform tools and platform. If I try to run monkeyrunner in a terminal I get the following exception: Exception in thread main java.lang.NoClassDefFoundError: com/android/chimpchat/ChimpChat at com.android.monkeyrunner.MonkeyRunnerStarter.init(MonkeyRunnerStarter.java:60) at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:188) Caused by: java.lang.ClassNotFoundException: com.android.chimpchat.ChimpChat at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 2 more Does anyone know how to fix this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.1 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner via TCP
When connecting monkeyrunner to a device via TCP, it throws up the Adb rejected adb port forwarding command: unknown host service error. I can successfully talk to the device using just adb (adb shell, install, push, pull etc.) Is there something that I am forgetting to set ? Should I start ADB before running monkeyrunner scripts ? Steps to reproduce: adb kill-server adb connect xxx.xxx.xxx.xxx * daemon not running. starting it now on port 5037 * * daemon started successfully * connected to xxx.xxx.xxx.xxx: adb devices List of devices attached xxx.xxx.xxx.xxx: device c:\android-sdk\tools\monkeyrunner.bat Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) [Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.7.0 from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice dev = MonkeyRunner.waitForConnection(20,xxx.xxx.xxx.xxx:) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Adb rejected adb port forwarding command: unknown host service 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.AdbCommandRejectedException: unknown host service 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.AdbHelper.createForward(AdbHelper.java:537) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.Device.createForward(Device.java:300) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice.createManager(AdbMonkeyDevice.java: 118) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice.init(AdbMonkeyDevice.java: 66) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbBackend.waitForConnection(AdbBackend.java: 100) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java: 78) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.lang.reflect.Method.invoke(Unknown Source) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java: 175) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java: 190) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyObject.__call__(PyObject.java:414) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyObject.__call__(PyObject.java:418) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.pycode._pyx6.f$0(stdin:1) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.pycode._pyx6.call_function(stdin) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyTableCode.call(PyTableCode.java:165) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.PyCode.call(PyCode.java:18) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.Py.runCode(Py.java:1197) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.core.Py.exec(Py.java:1241) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:147) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java: 89) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java: 70) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java: 46) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.util.InteractiveConsole.push(InteractiveConsole.java:110) 111018 13:42:18.308:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at org.python.util.InteractiveConsole.interact(InteractiveConsole.java: 90) 111018 13:42:18.308:S [main]
[android-developers] MonkeyRunner sample scripts
First time, I am trying to run Monkeyrunner script on a device. I have been getting the JavaNullPointer error when device.installpackage(..) method is called. I could not figure if I have received an invalid device object OR the parameter (test.apk) passed in the device.installpackage(..) method has any problem. Apparently, I get 0x1 deviceID when I print it on the interative shell I appreciate any pointers in effectively resolving the issue Thanks, Mandeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MonkeyRunner image compare
Hello, I'm having an issue with using MonkeyRunner. The goal of my script is to be able to compare saved screenshots with current screenshots in an app. I am still deciding whether to go with python or java, they're both having issues. With Python, the MonkeyImage.sameAs(MonkeyImage, percent) is not functioning. I get the error print str(result.sameAs(image2, 1.0)) at com.android.monkeyrunner.MonkeyImage.sameAs(MonkeyImage.java:138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 25) at java.lang.reflect.Method.invoke(Method.java:597) java.lang.ClassCastException: java.lang.ClassCastException: org.python.core.PySingleton cannot be cast to com.android.monkeyrunner.core.IMonkeyImage With Java, there is no loadImageFromFile function available. I've heard rumors about a ChimpChat.jar coming out that will be better to use with Java, but haven't actually seen it. Does anyone have any recommendations? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MonkeyRunner over TCP
I tried to use MonkeyRunner to access a device over TCP and ran into an unknown host service problem. Further digging revealed a May16 thread on this group from the MonkeyRunner author stating that this had not been tried and was unsure if it was possible. Has the capability to implement MonkeyRunner over TCP been added to more recent code? If not, what would it take and is it feasible to do so? I am interested in seeing this happen, and willing to chip in to make it happen, as it would make testing our device in different contexts much easier. thanks, Erick -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MonkeyRunner Start intent from java
Hi, I am using MonkeyRunner from java. Could some one help me in starting a activity from monkeyrunner. I can see a function called startActivity but I am not sure on how to use it properly http://developer.android.com/guide/developing/tools/MonkeyDevice.html#startActivity It will be really great if some one give me a sample. Thank you very much in advance. Thanks --Karthik -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner script for scroll and touch
Hi , I am writing monkeyrunner script to scroll screen, touch on specific menu item, long touch on an item. The script should haveonly touch operations as I am working with only touch enabled device(NO keypad, Full touch device). I came across one utility called androidlib.py which provides methods to perform many actions on device. In that there is a scroll() method, which is not performing successfully. path: https://github.com/eing/moet/blob/master/common/androidlib.py After first scroll(horizontally in home screen) , the focus went to contacts shortcut at the bottom of screen and it can't proceed with the second scroll. (Note: is it possible to embed touchevent constants like ACTION_SCROLL in that method?) I also tried with MonkeyDevice.drag() api, which requires hardcoded values of x, y screen coordinates which may not perform operation when the script runs on emulator or other device. Can you please help me with solution or any alternative for the same. Thanks in advance. frank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] MonkeyRunner Enhanced scripts
hello if you use internet for that please check you provide permission for access net or not... Regards, *Shailesh Mistry* +91 9974148507 On Mon, Jun 20, 2011 at 4:08 PM, Gaytri Batra gaytri.ba...@gmail.comwrote: Hello All, right now i am working on monkeyrunner tool to automate test cases of android playready application. I have completed with one module , but when we started executed I analyzed that it required same manual intervention as is required for manual testing. I want to enhance my scripts so that manual intervention is less. when test case is finished then looking at results logs used should be able to make it out which test case has been passed or failed. I am taking an simple example here: Suppose for my application, it requires to acquire license of content before start playback of content in application. For this when I am executed monkeyrunner script so I need to monitor the device whether it has been passed or failed. Can anyone please help in this how can i enhance my scripts at this point, I want proper logs should be saved and by looking at logs user should conclude test results. Can monkeyrunner supports junit API's ? is it good option to use junit API's? Or any other suggestions? Please revert back ASAP, it is very urgent. Thanks Regards, Gaytri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MonkeyRunner Enhanced scripts
Hello All, right now i am working on monkeyrunner tool to automate test cases of android playready application. I have completed with one module , but when we started executed I analyzed that it required same manual intervention as is required for manual testing. I want to enhance my scripts so that manual intervention is less. when test case is finished then looking at results logs used should be able to make it out which test case has been passed or failed. I am taking an simple example here: Suppose for my application, it requires to acquire license of content before start playback of content in application. For this when I am executed monkeyrunner script so I need to monitor the device whether it has been passed or failed. Can anyone please help in this how can i enhance my scripts at this point, I want proper logs should be saved and by looking at logs user should conclude test results. Can monkeyrunner supports junit API's ? is it good option to use junit API's? Or any other suggestions? Please revert back ASAP, it is very urgent. Thanks Regards, Gaytri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner - sending KEYCODE_ESCAPE
hi I have written the following command to instruct MonkeyRunner to send an escape keyevent to the emulator device.press(111, DOWN_AND_UP) But the escape never happens on the intended app. Even if I send this event multiple times the escape never works. Following is what I see in the logs ** 05-25 17:52:54.887: DEBUG/MonkeyStub(577): translateCommand: press 111 05-25 17:52:55.138: DEBUG/MonkeyStub(577): Quit requested 05-25 17:52:55.316: INFO/AndroidRuntime(577): AndroidRuntime onExit calling exit(8) Emulator is : Android2.2 - API level8 can anyone help me to sort this problem. thx isildur -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner + ADB over TCP
Hi. I'm using ADB over TCP [1] to access my device and it's working [2] but when I try to use my monkeyrunner script I got some errors, like: dev = MonkeyRunner.waitForConnection(20,192.168.50.14:7001) 110516 12:26:31.171:S [MainThread] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Adb rejected adb port forwarding command: unknown host service -OR- dev = MonkeyRunner.waitForConnection(20,192.168.50.14) Returns 'NoneType' to dev. Even when I have only one device attached and try waitForConnection() without parameters I got Adb rejected adb port forwarding command: unknown host service Somebody has a suggestion how can I proceed to fix that? Best regards, --tm [1] $ adb devices List of devices attached 192.168.50.14:7001device [2] $ adb -s 192.168.50.14:7001 shell getprop ro.product.cpu.abi armeabi-v7a -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] monkeyrunner + ADB over TCP
Hi, I've never tried using MonkeyRunner over TCP. There is a bunch of stuff inside MonkeyRunner that assumes you're connecting to the device over USB. Without changing the MonkeyRunner source code, I'm not sure it's possible to connect to a device over TCP. I'll take a look at it and see if I can add that feature. Bill On Mon, May 16, 2011 at 8:34 AM, Tiago Maluta tiago.mal...@gmail.comwrote: Hi. I'm using ADB over TCP [1] to access my device and it's working [2] but when I try to use my monkeyrunner script I got some errors, like: dev = MonkeyRunner.waitForConnection(20,192.168.50.14:7001) 110516 12:26:31.171:S [MainThread] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Adb rejected adb port forwarding command: unknown host service -OR- dev = MonkeyRunner.waitForConnection(20,192.168.50.14) Returns 'NoneType' to dev. Even when I have only one device attached and try waitForConnection() without parameters I got Adb rejected adb port forwarding command: unknown host service Somebody has a suggestion how can I proceed to fix that? Best regards, --tm [1] $ adb devices List of devices attached 192.168.50.14:7001device [2] $ adb -s 192.168.50.14:7001 shell getprop ro.product.cpu.abi armeabi-v7a -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Monkeyrunner extension library
FYI, for monkeyrunner users, check out androidlib.py which is an extension to the library - https://github.com/eing/moet/blob/master/common/androidlib.py moet usage : moet -d android [-os os] [-ic] [-res resolution] [-ic] [-s serial] [file] For interactive mode, use -i For image capture mode, use -c moet -h -d android available android commands: backspaces(num), enter(string) # supports spaces in strings scroll('up'/'down'/'left'/'right', num) back(), home(), menu(), record(), playback() touch(x,y), drag(fromX, fromY, toX, toY) touch('x%','y%'), drag('fromX%', 'fromY%', 'toX%', 'toY%') connect(serial), getDevice(), launch(appActivity) screenshot(filename) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] monkeyrunner with different android versions
Apparently the problem was in frameworks/base/core/java/android/view/KeyEvent.java where LAST_KEYCODE weren't pointing to latest item in KEY_NAMES [1]. [1] development/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java thanks. --tm On Wed, Apr 27, 2011 at 3:07 PM, Tiago Maluta tiago.mal...@gmail.com wrote: On Wed, Apr 27, 2011 at 2:51 PM, Bill Napier nap...@android.com wrote: what phone? There haven't been any changes to the monkeyrunner stuff on the device in that timeframe, so I'm not sure what the problem is. Android 2.2.1 running on Freescale Board (i.MX51) http://bit.ly/lwVEHN Android 2.3.3 running on Nexus One Did I forgot to add something when I compiled the framework or it's a default feature? thanks, --tm -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner with different android versions
Hi. I tested the same monkeyrunner [1] script on two android versions 2.3.3 and 2.2.1 and the last run partially. Some commands like (i.e: takeSnapshot()) works with some error messages and other don't (i.e: device.drag()) with a _lot_ of error messages. On my test script [2] I got: 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error getting the manager to quit 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]java.net.SocketException: Broken pipe 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite0(Native Method) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.write(SocketOutputStream.java:136) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:404) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:408) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.BufferedWriter.flush(BufferedWriter.java:236) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyManager.sendMonkeyEventAndGetResponse(MonkeyManager.java:167) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyManager.quit(MonkeyManager.java:288) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice.dispose(AdbMonkeyDevice.java:77) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbBackend.shutdown(AdbBackend.java:118) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:94) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:203) I faced other error too: 110427 11:41:08.783:S [MainThread] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error sending drag start event --- I know that are some modifications from 2.2.1 to 2.3.3 but what can you suggest to use since I need stay on 2.2.1? Am I using wrong monkeyrunner version? [1] Android SDK Tools, revision 9 [2] $ cat test.py from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device = MonkeyRunner.waitForConnection() result = device.takeSnapshot() result.writeToFile('snapshot.png','png') Kind regards, --tm -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] monkeyrunner with different android versions
what phone? There haven't been any changes to the monkeyrunner stuff on the device in that timeframe, so I'm not sure what the problem is. On Wed, Apr 27, 2011 at 7:59 AM, Tiago Maluta tiago.mal...@gmail.comwrote: Hi. I tested the same monkeyrunner [1] script on two android versions 2.3.3 and 2.2.1 and the last run partially. Some commands like (i.e: takeSnapshot()) works with some error messages and other don't (i.e: device.drag()) with a _lot_ of error messages. On my test script [2] I got: 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error getting the manager to quit 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]java.net.SocketException: Broken pipe 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite0(Native Method) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.write(SocketOutputStream.java:136) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:404) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:408) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.io.BufferedWriter.flush(BufferedWriter.java:236) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyManager.sendMonkeyEventAndGetResponse(MonkeyManager.java:167) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyManager.quit(MonkeyManager.java:288) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice.dispose(AdbMonkeyDevice.java:77) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbBackend.shutdown(AdbBackend.java:118) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:94) 110427 11:34:28.392:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:203) I faced other error too: 110427 11:41:08.783:S [MainThread] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error sending drag start event --- I know that are some modifications from 2.2.1 to 2.3.3 but what can you suggest to use since I need stay on 2.2.1? Am I using wrong monkeyrunner version? [1] Android SDK Tools, revision 9 [2] $ cat test.py from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device = MonkeyRunner.waitForConnection() result = device.takeSnapshot() result.writeToFile('snapshot.png','png') Kind regards, --tm -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] monkeyrunner with different android versions
On Wed, Apr 27, 2011 at 2:51 PM, Bill Napier nap...@android.com wrote: what phone? There haven't been any changes to the monkeyrunner stuff on the device in that timeframe, so I'm not sure what the problem is. Android 2.2.1 running on Freescale Board (i.MX51) http://bit.ly/lwVEHN Android 2.3.3 running on Nexus One Did I forgot to add something when I compiled the framework or it's a default feature? thanks, --tm -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Monkeyrunner error for device
I am trying to use monkeyrunner to automate a few tests on the device but keep running into the following error on a touch() or press() call. 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Erro r sending touch event: 240 720 DOWN_AND_UP 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]java. net.SocketException: Software caused connection abort: socket write error 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite0(Native Method) 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.socketWrite(Unknown Source) 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.net.SocketOutputStream.write(Unknown Source) 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source) . . . 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.ScriptRunner.console(ScriptRunner.java: 193) 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java: 89) 110401 11:47:40.034:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java: 20 3) However the calls for shell() method works fine. What might I be doing wrong? The same code works well on the eumlator. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Monkeyrunner not capturing screenshot correctly
HI guys, I've been trying to use monkeyrunner to capture screenshot of my app. However the screenshot often end up being black or not captured correctly e.g. only part of the screen is captured or it has a partial overlay of the previous screen. Is there a way of stopping this from happening? I initially thought it was because the app wasn't loading quick enough or it was taking some time to save the screenshot to memory or write to disk so I've put delays in between the steps but the images still come out corrupted. Help on solving this problem would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button
Hi, I tested this on Nexus S and it worked in the way I expected. If I specify DOWN_AND_UP, the screen locks and goes to sleep. If I specify just DOWN, I get the Phone options. I tried with the emulator and saw the same behavior you saw, I'm not sure why. Let me try and borrow an Xperia from somebody to reproduce there. On Thu, Mar 3, 2011 at 5:50 PM, aniruddha dhamal ani123.dha...@gmail.comwrote: Thanks Bill, But this code for short press on POWER button isn't working. I tried with emulator (Android 1.6, Android 2.1) and also on Xperia device. I also tried with controlling duration of the press but it opens the Phone Options. I wanted to simulate lock screen by pressing on POWER Button. With this command [ *device.press('KEYCODE_POWER', 'down') *] you can open the dialogue box which gives the Phone options (Silent Mode, Airplane Mode and Power off). Is there any other way to simulate the lock screen? Really Appreciate your help. On Thu, Mar 3, 2011 at 4:30 PM, Bill Napier nap...@android.com wrote: This worked for me. It turned off my Nexus S when I tried it. What you were doing was only sending the down part of the DOWN_AND_UP, so it was like you were pressing the POWER button and then never ever taking your finger off of it. If you want even more control over the duration of the press, you can do a DOWN, sleep for a bit, and then do the UP. DOWN_AND_UP runs the commands with no delay in-between at all (a really short press). - code snipped - from com.android.monkeyrunner import MonkeyRunner as mr from com.android.monkeyrunner import MonkeyDevice device = mr.waitForConnection() device.press(POWER, MonkeyDevice.DOWN_AND_UP) On Mon, Feb 28, 2011 at 11:56 AM, aniruddha dhamal ani123.dha...@gmail.com wrote: I tried to use *device.press('KEYCODE_POWER', 'down')* but this works for long press on power button. Thanks, On Sat, Feb 26, 2011 at 4:01 PM, Andya ani123.dha...@gmail.com wrote: Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button
Hi, I tried with Nexus S also [DOWN_AND_UP], but it didn't work ( behaviour: nothing happens). It might have locked the screen in your case because Display time (in Settings) was 15 sec (that's what happened with me initially but after changing that to 30 minutes it didn't work). I thought there is same behavior like emulator that when you press the power button it comes to the Lock screen. Coming to the lock screen can be achieved by restarting the device. But when i power it off, I lose the connection to the device (I have to restart the device manually). Thanks a lot, On Mon, Mar 7, 2011 at 10:58 AM, Bill Napier nap...@android.com wrote: Hi, I tested this on Nexus S and it worked in the way I expected. If I specify DOWN_AND_UP, the screen locks and goes to sleep. If I specify just DOWN, I get the Phone options. I tried with the emulator and saw the same behavior you saw, I'm not sure why. Let me try and borrow an Xperia from somebody to reproduce there. On Thu, Mar 3, 2011 at 5:50 PM, aniruddha dhamal ani123.dha...@gmail.comwrote: Thanks Bill, But this code for short press on POWER button isn't working. I tried with emulator (Android 1.6, Android 2.1) and also on Xperia device. I also tried with controlling duration of the press but it opens the Phone Options. I wanted to simulate lock screen by pressing on POWER Button. With this command [ *device.press('KEYCODE_POWER', 'down') *] you can open the dialogue box which gives the Phone options (Silent Mode, Airplane Mode and Power off). Is there any other way to simulate the lock screen? Really Appreciate your help. On Thu, Mar 3, 2011 at 4:30 PM, Bill Napier nap...@android.com wrote: This worked for me. It turned off my Nexus S when I tried it. What you were doing was only sending the down part of the DOWN_AND_UP, so it was like you were pressing the POWER button and then never ever taking your finger off of it. If you want even more control over the duration of the press, you can do a DOWN, sleep for a bit, and then do the UP. DOWN_AND_UP runs the commands with no delay in-between at all (a really short press). - code snipped - from com.android.monkeyrunner import MonkeyRunner as mr from com.android.monkeyrunner import MonkeyDevice device = mr.waitForConnection() device.press(POWER, MonkeyDevice.DOWN_AND_UP) On Mon, Feb 28, 2011 at 11:56 AM, aniruddha dhamal ani123.dha...@gmail.com wrote: I tried to use *device.press('KEYCODE_POWER', 'down')* but this works for long press on power button. Thanks, On Sat, Feb 26, 2011 at 4:01 PM, Andya ani123.dha...@gmail.com wrote: Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button
This worked for me. It turned off my Nexus S when I tried it. What you were doing was only sending the down part of the DOWN_AND_UP, so it was like you were pressing the POWER button and then never ever taking your finger off of it. If you want even more control over the duration of the press, you can do a DOWN, sleep for a bit, and then do the UP. DOWN_AND_UP runs the commands with no delay in-between at all (a really short press). - code snipped - from com.android.monkeyrunner import MonkeyRunner as mr from com.android.monkeyrunner import MonkeyDevice device = mr.waitForConnection() device.press(POWER, MonkeyDevice.DOWN_AND_UP) On Mon, Feb 28, 2011 at 11:56 AM, aniruddha dhamal ani123.dha...@gmail.comwrote: I tried to use *device.press('KEYCODE_POWER', 'down')* but this works for long press on power button. Thanks, On Sat, Feb 26, 2011 at 4:01 PM, Andya ani123.dha...@gmail.com wrote: Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button
Thanks Bill, But this code for short press on POWER button isn't working. I tried with emulator (Android 1.6, Android 2.1) and also on Xperia device. I also tried with controlling duration of the press but it opens the Phone Options. I wanted to simulate lock screen by pressing on POWER Button. With this command [ *device.press('KEYCODE_POWER', 'down') *] you can open the dialogue box which gives the Phone options (Silent Mode, Airplane Mode and Power off). Is there any other way to simulate the lock screen? Really Appreciate your help. On Thu, Mar 3, 2011 at 4:30 PM, Bill Napier nap...@android.com wrote: This worked for me. It turned off my Nexus S when I tried it. What you were doing was only sending the down part of the DOWN_AND_UP, so it was like you were pressing the POWER button and then never ever taking your finger off of it. If you want even more control over the duration of the press, you can do a DOWN, sleep for a bit, and then do the UP. DOWN_AND_UP runs the commands with no delay in-between at all (a really short press). - code snipped - from com.android.monkeyrunner import MonkeyRunner as mr from com.android.monkeyrunner import MonkeyDevice device = mr.waitForConnection() device.press(POWER, MonkeyDevice.DOWN_AND_UP) On Mon, Feb 28, 2011 at 11:56 AM, aniruddha dhamal ani123.dha...@gmail.com wrote: I tried to use *device.press('KEYCODE_POWER', 'down')* but this works for long press on power button. Thanks, On Sat, Feb 26, 2011 at 4:01 PM, Andya ani123.dha...@gmail.com wrote: Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button
I tried to use *device.press('KEYCODE_POWER', 'down')* but this works for long press on power button. Thanks, On Sat, Feb 26, 2011 at 4:01 PM, Andya ani123.dha...@gmail.com wrote: Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Aniruddha Dhamal ani123.dha...@gmail.com No matter which direction you start Its always against the wind coming back -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] [Monkeyrunner]: How to simulate short press on power button
Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] [Monkeyrunner]: How to simulate short press on power button
Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MonkeyRunner
Hi All, I want to know files needed(for python) to start work with monkeyrunner tool. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MonkeyRunner
Just as a note: The documentation for the Android 2.3 SDK is now online at developer.android.com. It is also one of the packages available for download through the SDK manager. This documentation includes documentation for monkeyrunner. Although monkeyrunner is not part of the Android 2.2 SDK, you can get monkeyrunner from the Android Open Source Project at source.developer.com. It probably works with Android 2.2. You're probably better off upgrading to Android 2.3. If you have more questions, please read the documentation. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner - How to simulate long press
Hi, any clue how to simulate long key press in MonkeyRunner? E.g. Long press on HOME key, or long press on list item to invoke context- sensitive-menu. I was expecting it should happen by the following code or similar code: device.press('KEYCODE_HOME','DOWN') but unfortunately only DOWN press also behaving like DOWN_AND_UP. There is no difference between these two. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] monkeyrunner fails for emulator: Error starting command: monkey --port 12345
Hi, I am trying to run 'monkeyrunner' tool for emulator and I end up with the below error: 101209 13:12:11.321:I [main] [com.android.monkeyrunner.MonkeyManager] Monkey Command: wake. 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error starting command: monkey --port 12345 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.ShellCommandUnresponsiveException 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.ddmlib.Device.executeShellCommand(Device.java:276) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at com.android.monkeyrunner.adb.AdbMonkeyDevice $1.run(AdbMonkeyDevice.java:89) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java: 417) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.FutureTask.run(FutureTask.java:123) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.ThreadPoolExecutor $Worker.runTask(ThreadPoolExecutor.java:651) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:676) 101209 13:12:14.345:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] at java.lang.Thread.run(Thread.java:595) ... ... ... I am having the following environment: OS : Ubuntu 10.04 Jython : 2.2.1 Android SDK : 2.3 (GingerBread) Device : Emulator The target app for monkeyrunner is one of my DummyApp. Here is the jython script I am using (its same one mentioned at http://d.android.com/guide/developing/tools/monkeyrunner_concepts.html) from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device = MonkeyRunner.waitForConnection() device.installPackage('/home/swarup/DummyApp.apk') device.startActivity(component='com.collabera.swarup.DummyActivity') device.press('KEYCODE_MENU','DOWN_AND_UP') result = device.takeSnapShot() result.writeToFile('myproject/shot1.png','png') Running only 'monkey' command works fine, but monkeyrunner fails. Any clue in this regard would be a great help. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en