@@ -530,6 +530,27 @@ def close_app(self):
530530 self .execute (Command .CLOSE_APP )
531531 return self
532532
533+ def start_activity (self , app_package , app_activity , app_wait_package = '' , app_wait_activity = '' ):
534+ """Opens an arbitrary activity during a test. If the activity belongs to
535+ another application, that application is started and the activity is opened.
536+
537+ This is an Android-only method.
538+
539+ :Args:
540+ - app_package - The package containing the activity to start.
541+ - app_activity - The activity to start.
542+ - app_wait_package - Begin automation after this package starts.
543+ - app_wait_activity - Begin automation after this activity starts.
544+ """
545+ data = {
546+ 'appPackage' : app_package ,
547+ 'appActivity' : app_activity ,
548+ 'appWaitPackage' : app_wait_package ,
549+ 'appWaitActivity' : app_wait_activity
550+ }
551+ self .execute (Command .START_ACTIVITY , data )
552+ return self
553+
533554 def end_test_coverage (self , intent , path ):
534555 """Ends the coverage collection and pull the coverage.ec file from the device.
535556 Android only.
@@ -684,6 +705,8 @@ def _addCommands(self):
684705 ('POST' , '/session/$sessionId/appium/device/install_app' )
685706 self .command_executor ._commands [Command .REMOVE_APP ] = \
686707 ('POST' , '/session/$sessionId/appium/device/remove_app' )
708+ self .command_executor ._commands [Command .START_ACTIVITY ] = \
709+ ('POST' , '/session/$sessionId/appium/device/start_activity' )
687710 self .command_executor ._commands [Command .LAUNCH_APP ] = \
688711 ('POST' , '/session/$sessionId/appium/app/launch' )
689712 self .command_executor ._commands [Command .CLOSE_APP ] = \
0 commit comments