Rice University logo
 
Top blue bar image
 

Archive for the ‘Framework Debugging’ Category


Monkey from Songtao

September 23rd, 2015 by mhyun

import time

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice

device = MonkeyRunner.waitForConnection()

# Touch down screen
device.touch(110, 500, MonkeyDevice.DOWN)

# Move from 100, 500 to 300, 500
for j in range(1,100):
for i in range(0, 100):
device.touch(100+j*10, 500+i*10, MonkeyDevice.MOVE)
print “move “, 100 + 20 * i, 500
time.sleep(0.001)

# Move from (300, 500 to 200, 500)
for i in range(0, 100):
device.touch(110+j*10, 500 + 100 * 10 – 10 * i, MonkeyDevice.MOVE)
print “move “, 300, 500 – 10 * i
time.sleep(0.001)

# Remove finger from screen
device.touch(300, 400, MonkeyDevice.UP)

Where is app dir?

October 11th, 2014 by mhyun

/data/data/

Looking into the system.img

April 18th, 2014 by mhyun

out/host/linux-x86/bin/simg2img system.img system.img.raw

mkdir fs_system

sudo  mount -t ext4 -o loop system.img.raw fs_system/

Add a directory to build path

February 3rd, 2014 by mhyun

include the directory you want to build into

/build/core/pathmap.mk

 

Remount /factory

November 25th, 2013 by mhyun

mount -oremount,rw /factory

Update android.jar – custom jar

October 23rd, 2013 by mhyun

cp ~/android_gns/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes/* . -R

zip -r android.jar .

Inject touch events

August 29th, 2013 by mhyun

#!/usr/bin/env python

import os

os.system(‘adb shell sendevent /dev/input/event1 3 57 100’)
os.system(‘adb shell sendevent /dev/input/event1 3 48 15’)
os.system(‘adb shell sendevent /dev/input/event1 3 58a 191’)
os.system(‘adb shell sendevent /dev/input/event1 3 53 347’)
os.system(‘adb shell sendevent /dev/input/event1 3 54 482’)
os.system(‘adb shell sendevent /dev/input/event1 0 0 0’)
os.system(‘adb shell sendevent /dev/input/event1 3 57 0’)
os.system(‘adb shell sendevent /dev/input/event1 0 0 0’)

event1 can be changed. Run getevent