RBM library APIs
High level API for controlling your android phone
The RBM library is an API wrapper of the Robotmon JavaScript APIs.
RBM Config
property
description
appName
The name of the script.
oriScreenWidth
The width of developer's phone.
oriScreenHeight
The height of developer's phone.
oriVirtualButtonHeight
The virtual button height of developer's phone(getVirtualButtonHeight()
). If no virtual button in app, just set to 0
.
oriResizeFactor
The resize ratio of the screenshot in developer's environment. For screencrop()
. Range from 0
to 1
.
eventDelay
The delay milliseconds of the event.
imageThreshold
The threshold of image recognition. Range from 0
to 1
.
imageQuality
The compression level of the image. Range from 0
to 100
.
resizeFactor
The resize ratio of the screenshot in user's environment. Same as oriResizeFactor
is better. Range from 0
to 1
.
Using
RBM library
args
any type - if argument is object, it will convert object to JSON string
For general output of logging information.
Returns Object
- The current app in foreground. {packageName: String, activityName: String}
packageName
StringactivityName
String
Launch an app by packageName
and activityName
.
packageName
String
Close an app by packageName
.
position
Object -{x: Integer, y: Integer}
position
Object -{x: Integer, y: Integer}
position
Object -{x: Integer, y: Integer}
position
Object -{x: Integer, y: Integer}
from
Object -{x: Integer, y: Integer}
to
Object -{x: Integer, y: Integer}
steps
Integer - Interpolation points betweenfrom
andto
label
String
words
String
Sleep with eventDelay
.
Returns String
- The path of the image folder. All about images used in this library will load and save within this folder.
filename
String
Save the screenshot in rbm.getImagePath()
.
filename
StringfromX
IntegerfromY
IntegertoX
IntegertoY
Integer
Crop the original screenshot and save it with filename
. This function will resize the image with oriResizeFactor
and compress with imageQuality
.
filename
StringfromX
IntegerfromY
IntegertoX
IntegertoY
Integer
Crop the screenshot and save it with filename
. This function will resize the image with resizeFactor
and compress with imageQuality
.
filename
Stringthreshold
Float
Returns Object
- Find the image with filename
in screen. {x: Integer, y: Integer, score: Float}
filename
Stringthreshold
FloatcountLimit
IntegerallowOverlap
Booleandeep
Boolean
Returns Object
- Find the image with filename
in screen. {x: Integer, y: Integer, score: Float}
filename
Stringthreshold
Float
Returns Boolean
- Whether the image is exists in screen.
filename
Stringthreshold
Float
Click the image if the image is exists in screen.
filename
Stringtimeout
Integerthreshold
Float
Click the image if the image is exists in screen until timeout (milliseconds).
filename
Stringtimeout
Integerthreshold
Float
Block until the image is found or timeout
filename
Stringtimeout
Integerthreshold
Float
Block until the image is gone or timeout
Keep the screenshot in memory. To avoid to many times screencap.
fromX
IntegerfromY
IntegertoX
IntegertoY
Integer
Keep the partial screenshot in memory. To avoid to many times screencap.
Release the screenshot in memory.
Using keepScreenshot
Last updated