-
Notifications
You must be signed in to change notification settings - Fork 0
API Controllers
The device actor is a class that needs the device to be created. It doesn't provide any methods.
The Activity interface contains two properties. The appPackage
and the activityPackage
.
The AppController extends from the DeviceActor. The AppController contains methods for app controlling.
Creates a new instance of this controller
Get the currently opened activites. This will return a promise with an array of activities. This array will even include the paused activites.
console.log(await emulator.apps.openActivities());
Install an app from your local file system. The pathToApp parameter should point to the apk location, like path/to/app/appName.apk
Returns a promise containing an array of all activities this package has. The package is just the identifier for your app.
This start the app with the package name provided. Returns a promise with a ExecResult
This starts a special activity of an app. This method should be preferred over the startApp method, as this method also wait until the app fully loaded before resolving the promise. Returns a promise with the ExecResult that will resolve when the app has fully loaded.
await emulator.apps.startActivity({
appPackage: DefaultApps.CHROME,
activityPackage: "org.chromium.chrome.browser.ChromeTabbedActivity"
});
This method returns a promise that gets resolved as soon as the required activity has been found. The timeout parameter is the time that passes before the check for the activity will be rerun
Returns a promise with true or false, representing if the app has been installed on this device.
This method kills the app with the known package name. Returns a promise with the ExecResult
await emulator.apps.killApp(DefaultApps.CHROME);
This method returns a promise containig true or false. True when the package name is running. False when it isn't
The FileControllerextends from the DeviceActor. The FileController contains methods for controlling file uploads and downloads
Creates a new instance of this controller
This method will copy the file from the device to your local machine. The deviceFilePath is the location on the device and the localFilePath is the path to the file on your computer (Which may not exit yet). Returns a promise containing the ExecResult
The file will get override if it exists.
This method will copy the file from your machine to your device. The deviceFilePath is the location on the device (Which may not exit yet) and the localFilePath is the path to the file on your computer. Returns a promise containing the ExecResult
The file will get override if it exists.