Start an Android activity by providing package name, activity name and other optional parameters.

More info here: https://appium.io/docs/en/commands/device/activity/start-activity/

Usage

                    .appium.startActivity(opts, [callback])
                

Example

module.exports = {
  'start an android activity': function (app) {
    app
      .appium.startActivity({
        appPackage: 'com.android.chrome',
        appActivity: 'com.google.android.apps.chrome.Main'
      });
  },

  'start the main Android activity and wait for onboarding activity to start': function (app) {
    app
      .appium.startActivity({
        appPackage: 'org.wikipedia',
        appActivity: 'org.wikipedia.main.MainActivity',
        appWaitActivity: 'org.wikipedia.onboarding.InitialOnboardingActivity'
      });
  }
};

Parameters

Name Type description
opts string

Options to start the activity with. appPackage and appActivity are required, others are optional.

callback
Optional
function

Optional callback function to be called when the command finishes.

See also