我是culebra的新手,我遇到了一些问题。
首先,文件说明我应该使用
culebra -G
启动GUI。但是,我正在使用python culebra -G
否则它将无法识别为有效命令。
其次,在启动命令后,我会在一段时间后得到此异常。
C:\Users\User\AppData\Local\Android\sdk\platform-tools>python culebra -G
C:\Python27\lib\site-packages\androidviewclient-10.5.1-py2.7.egg\com\dtmilano\an
droid\viewclient.py:2485: UserWarning: Running on emulator but no serial number
was specified then 'emulator-5554' is used
warnings.warn("Running on emulator but no serial number was specified then 'em
ulator-5554' is used")
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (C) 2013-2014 Diego Torres Milano
Created on 2015-08-13 by Culebra v10.5.1
__ __ __ __
/ \ / \ / \ / \
____________________/ __\/ __\/ __\/ __\_____________________________
___________________/ /__/ /__/ /__/ /________________________________
| / \ / \ / \ / \ \___
|/ \_/ \_/ \_/ \ o \
\_____/--<
@author: Diego Torres Milano
@author: Jennifer E. Swofford (ascii art snake)
'''
import re
import sys
import os
from com.dtmilano.android.viewclient import ViewClient
TAG = 'CULEBRA'
_s = 5
_v = '--verbose' in sys.argv
kwargs1 = {'ignoreversioncheck': False, 'verbose': False, 'ignoresecuredevice':
False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'compresseddump': True, 'startviewserver': True, 'forceviewserveruse'
: False, 'autodump': False, 'ignoreuiautomatorkilled': True}
vc = ViewClient(device, serialno, **kwargs2)
#vc.dump(window='-1') # FIXME: seems not needed
Traceback (most recent call last):
File "culebra", line 1080, in <module>
runCulebron()
File "culebra", line 786, in runCulebron
culebron.takeScreenshotAndShowItOnWindow()
File "C:\Python27\lib\site-packages\androidviewclient-10.5.1-py2.7.egg\com\dtm
ilano\android\culebron.py", line 249, in takeScreenshotAndShowItOnWindow
self.unscaledScreenshot = self.device.takeSnapshot(reconnect=True)
File "C:\Python27\lib\site-packages\androidviewclient-10.5.1-py2.7.egg\com\dtm
ilano\android\adb\adbclient.py", line 611, in takeSnapshot
received = self.__receive(1 * 4 + 12 * 4)
File "C:\Python27\lib\site-packages\androidviewclient-10.5.1-py2.7.egg\com\dtm
ilano\android\adb\adbclient.py", line 233, in __receive
chunk = self.socket.recv(min((nob - nr), 4096))
socket.timeout: timed out
答案 0 :(得分:0)
您只需为culebra命令提供设备ID即可。通过这样做获取您的设备/模拟器ID:
adb devices -l
也许会显示 01a4968dd882b783 。
然后,用这样的东西运行culebra:
culebra -L -uUG --scale=0.2 -o myTestCase.py 01a4968dd882b783