I am not sure what purpose can Accessibility Inspector have in your automation but here is my answer.
Ruby cannot manipulate "iPhone Simulator" directly, every action (e.g. "Reset") is performed using Apple Script. Apple Script simulates user clicks on the menus.
For some examples, go to Frank HostScripting module source
Modifying the menu indices in
def simulator_reset_data
%x{osascript<<APPLESCRIPT
activate application "iPhone Simulator"
tell application "System Events"
click menu item 5 of menu 1 of menu bar item 2 of menu bar 1 of process "#{Localize.t(:iphone_simulator)}"
delay 0.5
click button 2 of window 1 of process "#{Localize.t(:iphone_simulator)}"
end tell
APPLESCRIPT}
end
should give you the required result (the delay
and the 2nd click
line can be removed, they handle the "reset" confimation dialog).