Let's say you open MMS, start a New Message, and then press Attach
when this dialog is displayed you run culebra as
$ culebra -C -t on -o mms-attach.py
edit generated mm-attach.py
to remove unneeded parts and add the touch()
method. Your script would be something like this:
#! /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()
you run it, and then Pictures is selected and now your are in the Choose picture screen as desired.