Thursday, December 9, 2010

[android-developers] Re: monkeyrunner fails for emulator: Error starting command: monkey --port 12345

Try replacing your call to startActivity with:
device.startActivity(component='com.collabera.swarup/.DummyActivity')

Greg

On Dec 9, 1:11 pm, swarup <me.s...@gmail.com> wrote:
> Nope, ignoring didn't help, its not launching target activity. The
> menu key is getting pressed on the home screen itself, and whole test
> case fails :(
> Also I noticed the same issue for CTS 2.2, lots of test cases fail
> with same error.
>
> any clue for this issue would be appreciated.
>
> On Dec 9, 11:34 pm, Bill Napier <nap...@android.com> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > You can safely ignore that log message.  I know it looks scary, but things
> > are still working (I got the same message when I just tried, but the rest of
> > the script ran fine).  In a later build that message will be totally be
> > gone.
>
> > Also, I noticed a slight typo in the docs regarding takeSnapshot.  The
> > correct code should look like this:
>
> > # Takes a screenshot
> > result = device.takeSnapshot()
>
> > Bill
>
> > On Thu, Dec 9, 2010 at 12:26 AM, swarup <me.s...@gmail.com> wrote:
> > > the same issue also seen on ADP1.
> > > I tried tunning monkeyrunner on ADP1, and got the exact the same
> > > error.
>
> > > Looks like not emulator problem, might be a ADB code issue.
>
> > > did anyone face similar issue?
>
> > > On Dec 9, 1:02 pm, swarup <me.s...@gmail.com> wrote:
> > > > 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.ShellComma
> > > ndUnresponsiveException
> > > > 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 athttp://
> > > 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+unsubscribe@googlegroups.com<android-developers%2Bunsubs cribe@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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment