-
Notifications
You must be signed in to change notification settings - Fork 16
API
GET /health
Hopefully prints a nice, welcoming message.
POST /session {
"bundleID" : "com.companyname.example",
"bundlePath" : "/abs/path/to/MyApp.app", // optional if app already installed
"launchArgs" : [ "arg1", "arg2", ... ], // optional
"environment" : { "key" : "val", ... } // optional
}
Starts/launches the specified app
DELETE /session
Kills the current application. As a side effect of a known issue in XCUITest, also kills the server.
POST /shutdown {
}
Shuts the server down by forcing it to exit(0).
POST /swipe/{up, down, left, right}
Performs a swipe action on the entire app screen. Doesn't seem to be a way to control velocity.
POST /tap/coordinates {
"x" : Number,
"y" : Number
}
Performs a tap gesture at OpenGL position x, y on the main screen. The coordinate space is the resolution of the screen, not the size of the app window (e.g. on an iPad, if your app is running at 1x, the coordinates for an element will be different than if it is running at 2x. The boundaries of the screen would be 0,0,1024,768).
POST /doubleTap/coordinates
{
x : Number,
y : Number
}
POST /pressForDuration/coordinates
{
x : Number,
y : Number,
duration: Number
}
POST /pressForDuration/coordinates/thenDragTo
{
x1 : Number,
y1 : Number,
x2 : Number,
y2 : Number,
duration: Number
}
POST /tap/marked/:text
{ }
POST /doubleTap/marked/:text
{ }
POST /twoFingerTap/marked/:text
{ }
POST /swipe/{up, down, left, right}/marked/:text
{ }
POST /pinchWithScaleAndVelocity/marked/:text
{
scale: Number, //1.0 == no zoom, < 1.0 == zoom out
velocity: Number //"scale points per second"
}
POST /rotateWithVelocity/marked/:text
{
degrees: Number,
velocity: Number //degrees per second
}
POST /typeText/marked/:text
{
text: String //string to type
}
POST /tapWithNumberOfTapsAndTouches/marked/:text
{
taps : Number,
touches : Number
}
POST /pressForDuration/marked/:text
{
duration: Number
}
POST /pressForDuration/marked/:text1/thenDragToElement/marked/:text2
{
duration: Number
}
[Note, the following APIs are identical to the 'marked' APIs except for using /id/:id in place of /marked/:text in the route name].
- /tap/id/:id
- /doubleTap/id/:id
- /twoFingerTap/id/:id
- /swipe/:direction/id/:id
- /pinchWithScaleAndVelocity/id/:id
- /rotateWithVelocity/id/:id
- /typeText/id/:id
- /tapWithNumberOfTapsAndTouches/id/:id
- /pressForDuration/id/:id
- /pressForDuration/id/:id1/thenDragToElement/id/:id2
GET /tree
Returns a JSON dump of the current view hierarchy. It's not super informative, as the XCUIElements are really just proxy representations of the native views and thus don't contain a lot of information. However, you can glean basic knowledge about what's present. A typical element looks like:
{
"enabled": true,
"id": "Settings",
"title": "",
"rect": {
"y": 20,
"x": 0,
"height": 44,
"width": 375
},
"label": "",
"value": "",
"type": 21, //we can stringify this at some point, the numbers correspond to more informative 'XCUIElemenTypes'
"children" : [ ... ] //only present if there are children.
}
GET /query/marked/:text
Returns an array of elements with value, label, or title == :text. Format is the same as tree, minus the children.
GET /query/id/:id
Returns an array of elements with identifier or accessibilityIdentifier == :id. Format is the same as tree, minus the children.