monkeyrunner

Monkeyrunner doesnt find my module

半腔热情 提交于 2019-12-11 12:53:21
问题 I have installed psutil module. It works well if run by the python interpreter but when I try to import the module in a monkeyrunner script,it gives No such module. Is there any way through which i use psutil module in monkeyrunner? Note-i am using the monkeyrunner with the android ics-x86 version 回答1: Try to name your script something.py . This way you have a python script where you can import the modules. When you run the script with monkeyrunner, some python modules are not recognized.

android monkey script for multiple devices

隐身守侯 提交于 2019-12-11 11:15:53
问题 Can some body can help me for to put android monkey test for multiple devices ? ->adb shell monkey -p com.example -v 500000 So here i have connected 10 devices in my PC. I wanted to run monkey test for all the device and capture the logs at the same time. Can any one suggest me on this ? 回答1: Use a script like this: #! /bin/bash for s in s1 s2 s3 do adb -s $s shell monkey -p com.example -v 500000 > $s.log done where s1, s2, ... are the serial number of your devices 来源: https://stackoverflow

Is there any way of quickening monkeyrunner script execution?

淺唱寂寞╮ 提交于 2019-12-11 04:32:27
问题 I've got a particular monkeyrunner script (in Jython), which I use for taking screenshots or touching particular coordinates. My main program is written in Perl - it just executes monkeyrunner scripts when their functionality is need. The problem is in slowness of such method: every time in monkeyrunner script I should get a MonkeyDevice object and work with it: device = MonkeyRunner.waitForConnection() And the whole operation seems to take from 5 to 9 seconds, which is very slow for my

How to record touches and emulate them later on real devices (with ROOT if needed)?

ⅰ亾dé卋堺 提交于 2019-12-10 15:08:36
问题 Background the monkeyRunner (and monkey) is a nice tool to test out apps. I have an idea of using it (or something similar) to record & emulate touches (and keys). The problem The tool itself has some disadvantages: needs to be run on an emulator or on a device that is connected to a PC. needs adb. it needs that you type it exactly what to do , which requires a lot of patience and trial&error in order to find out what to write. has limitations on how many devices to run (since it needs to be

How to run Monkeyrunner script on multiple devices at the same time

纵然是瞬间 提交于 2019-12-10 14:47:43
问题 I am trying to run a monkeyrunner script on multiple devices to do some basic operations.I figured out that initialy I will start of writing a script to perform basic action in two connected devices. from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice import time import sys import time devices = os.popen('adb devices').read().strip().split('\n')[1:] device1 = MonkeyRunner.waitForConnection( devices[0].split('\t')[0]) package = 'com.android.browser' activity = 'com.android.browser

How to inherit from MonkeyDevice?

孤街醉人 提交于 2019-12-10 12:49:44
问题 I would like to extend the MonkeyDevice class of the monkeyrunner API. My derived class looks like this. from com.android.monkeyrunner import MonkeyDevice, MonkeyRunner class TestDevice(MonkeyDevice): def __init__(self, serial=None): MonkeyDevice.__init__(self) self = MonkeyRunner.waitForConnection(deviceId=serial) self.serial = serial When I call test_dev = TestDevice(serial) from another module I get the following error: test_dev = TestDevice(serial) TypeError: _new_impl(): 1st arg can't be

how to delete text from a text field using monkeyrunner API (Python script)

廉价感情. 提交于 2019-12-10 10:12:51
问题 I am trying to delete text from a text field using monkeyrunner API . I am writing script in python. There are key events like " KEYCODE_FORWARD_DEL","KEYCODE_DEL" and to move the cursor to the end "KEYCODE_MOVE_END". I am trying to delete text, for this, I tried to move the cursor to the end but"KEYCODE_MOVE_END" did not work. Cursor did not move at all. Then, I tried to use " KEYCODE_FORWARD_DEL" but it also did not work. These, keys are working for the text field in which I entered text

Monkey Runner throwing socket exception broken pipe on touuch

爱⌒轻易说出口 提交于 2019-12-09 20:50:46
问题 I see the below error sometimes while running monkeyrunner scripts. 140501 17:01:58.950:S [MainThread] [com.android.chimpchat.adb.AdbChimpDevice] Error sending touch event: 500 515 DOWN_AND_UP 140501 17:01:58.950:S [MainThread] [com.android.chimpchat.adb.AdbChimpDevice]java.net.SocketException: Broken pipe 140501 17:01:58.950:S [MainThread] [com.android.chimpchat.adb.AdbChimpDevice] at java.net.SocketOutputStream.socketWrite0(Native Method) 140501 17:01:58.950:S [MainThread] [com.android

android monkey runner scripts

僤鯓⒐⒋嵵緔 提交于 2019-12-09 10:05:02
问题 i am tryig to execute a sample python program through monkey runner command prompt and it is throwing an error Can't open specified script file Usage: monkeyrunner [options] SCRIPT_FILE -s MonkeyServer IP Address. -p MonkeyServer TCP Port. -v MonkeyServer Logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, OFF) Exception in thread "main" java.lang.NullPointerException so any one can guide me how to resolve this one 回答1: scriptfile should be a full path file name try below

Why does MonkeyRunner.waitForConnection() error “Adb rejected adb port forwarding command: cannot bind socket”

痞子三分冷 提交于 2019-12-08 04:37:46
问题 When I try to get a device with MonkeyRunner I get this message: newdevice = MonkeyRunner.waitForConnection() 110804 17:35:28.561:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Adb rejected adb port forwarding command: cannot bind socket 110804 17:35:28.561:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.AdbCommandRejectedException: cannot bind socket I'm running monkeyrunner.bat from the commandline in windows Xp with JDK 1.6.0_26, Python 2.7.2, and Android