2. Console
~/libcat/script$ ./console.rb
ls TARGET : list target object (l) help : help (h)
> ls : list current object quit : quit (q)
> ls -r : list recursive about : about libcat Console
cd TARGET : change target object clear : clear the screen
> cd : to topViewController history : input commands history
> cd . : to self sleep N : sleep N seconds
> cd .. : to superview
> cd / : to rootViewController class introspection
> cd ~ : to keyWindow > classInfo TARGET (c)
> cd ~~ : to UIApplication > methods TARGET (m)
> cd 0 : at index as listed > classMethods TARGET (M)
> cd 1 0 : at section and row > ivars TARGET (i)
> cd Title : labeled as Title > protocols TARGET
> cd view : to property > UIApplication
> cd UIButton : to class > UITableViewDelegate
> cd 0x6067490 : at memory address enum ENUMTYPE : enum type info
pwd : view & controller hierarchy > enum UIInterfaceOrientationPortrait
properties TARGET : list properties (p) > enum UIInterfaceOrientation
> text : property getter map ARGS
> text = hello : property setter > view.subviews.map text frame.size
flick TARGET : flick target UI (f) events (USE_PRIVATE_API) : list touch events (e)
touch TARGET : touch target UI (t) > events record : record on/off (er)
back : popViewController UI (b) > events play : play events (ep)
drag TARGET : drag target UI (d) > events cut N : cut N events (ex)
rm TARGET : removeFromSuperview UI > events clear : clear events (ec)
png TARGET : capture target as image UI > events replay NAME : replay events (ee)
> events save NAME : save events (es)
open : open Safari UI (o) > events load NAME : load events (el)
Object Navigation
ls TARGET
cd TARGET
pwd
TARGET
> cd . : to self
> cd .. : to superview
> cd / : to rootViewController
> cd ~ : to keyWindow
> cd ~~ : to UIApplication
> cd 0 : at index as listed
> cd 1 0 : at section and row
> cd -1 0 : at index on toolbar
> cd Title : labeled as Title
> cd view : to property
> cd UIButton : to class
> cd 0x6067490 : at memory address
Properties
> properties
> text
> backgroundColor
> view.frame.size
> text = hello
> backgroundColor = redColor
> alpha = 0.5
> view.frame = {{0, 0}, {320, 416}}
.
3. Class Introspection
> classInfo TARGET (c)
> methods TARGET (m)
> classMethods TARGET (M)
> ivars TARGET (i)
> protocols TARGET
> UIApplication
> UITableViewDelegate
map ARGS
> view.subviews.map text frame.size
> view.subviews.map frame subviews.count
Show UIViews on Web Browser
open
UI commands
flash (f)
touch (t)
back (b)
drag (d)
rm TARGET
png TARGET
Automation Script
require './console'
c = Console.new
c.input 'ls'
c.input 'view.backgroundColor = greenColor'
script/test_script.rb
UI Events Recorder
> events : list touch events (e)
> events record : record on/off (er)
> events play : play events (ep)
> events cut N : cut N events (ex)
> events clear : clear events (ec)
> events replay NAME : replay events (ee)
> events save NAME : save events (es)
> events load NAME : load events (el)
USEPRIVATEAPI=1
Examples
object introspection https://gist.github.com/879287
media query https://gist.github.com/870633
list properties https://gist.github.com/831768