Device
Activity
Start Activity
Start an Android activity by providing package name and activity name
Java:driver.startActivity(new Activity("com.example", "ActivityName"));
Python:self.driver.start_activity("com.example", "ActivityName");
Get Current Activity
Get the name of the current Android activity
Java:String activity = driver.currentActivity();
Python:activity = self.driver.current_activity;
Get Current Package
Get the name of the current Android package
Java:String package = driver.getCurrentPackage();
Python:package = self.driver.current_package;
Install App
Install the given app onto the device
Java:driver.installApp("/Users/johndoe/path/to/app.apk");
Python:self.driver.install_app('/Users/johndoe/path/to/app.apk');
Is App Installed
Check whether the specified app is installed on the device
Java:driver.isAppInstalled("com.example.AppName");
Python:self.driver.is_app_installed('com.example.AppName');
Launch an App
Launch an app on device
Java:driver.launchApp();
Python:self.driver.launch_app()
Background App
Send the currently running app for this session to the background
Java:driver.runAppInBackground(Duration.ofSeconds(10));
Python:self.driver.background_app(10)
Close an App
Close an app on device
Java:driver.closeApp();
Python:self.driver.close_app()
Reset App
Reset the currently running app for this session
Java:driver.resetApp();
Python:self.driver.reset()