假设您打开MMS,开始一条New Message,然后按Attach
当显示此对话框时,您将culebra运行为
$ culebra -C -t on -o mms-attach.py
生成的编辑mm-attach.py
删除不需要的部分并添加touch()
方法。您的脚本将是这样的:
#! /usr/bin/env shebang monkeyrunner -plugin $ANDROID_VIEW_CLIENT_HOME/bin/androidviewclient-$ANDROID_VIEW_CLIENT_VERSION.jar @!
# -*- coding: utf-8 -*-
'''
Copyright (C) 2013 Diego Torres Milano
Created on 2013-05-14 by Culebra v0.9.8
__ __ __ __
/ \ / \ / \ / \
____________________/ __\/ __\/ __\/ __\_____________________________
___________________/ /__/ /__/ /__/ /________________________________
| / \ / \ / \ / \ \___
|/ \_/ \_/ \_/ \ 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
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device, serialno = ViewClient.connectToDeviceOrExit()
vc = ViewClient(device, serialno, autodump=False)
vc.dump(window='-1')
# unneeded views removed
# class=android.widget.TextView text="Pictures"
no_id14 = vc.findViewWithTextOrRaise('Pictures')
no_id14.touch()
您运行它,然后选择图片,现在您可以根据需要在选择图片屏幕中。