Search code examples
androidcalabash-android

Calabash-android: application open browser and i can't get it any more


I am testing an Android application using calabash for Android. The application open the browser after some treatment, and so I am losing control on my application. How can I go back to the app after the browser is opened and it's on foreground.


Solution

  • After you have been redirected out of the app , you can bring it back from the background with the following command

        system("#{default_device.adb_command} shell am start  -n 'PATH_TO_ACTIVITY_IN_THE_SYSTEM' -a android.intent.action.MAIN -c android.intent.category.LAUNCHER")