Integrating Appium with Fastlane
Integrate your Appium test suite with Fastlane and the BrowserStack device cloud for native and hybrid apps using our Fastlane plugin.
Add BrowserStack's Fastlane plugin by executing the below command:
fastlane add_plugin browserstack
You can easily upload your app using BrowserStack Fastlane Plugin and execute your test on the BrowserStack cloud. In order to configure the plugin add below action in your Fastfile. You can also refer to the sample android project, which demonstrates the use of this plugin.
upload_to_browserstack_app_automate( browserstack_username: ENV["BROWSERSTACK_USERNAME"], browserstack_access_key: ENV["BROWSERSTACK_ACCESS_KEY"], file_path: "<path_to_your_apk_or_ipa_file>", custom_id: "<custom_id_name>" )
Once the app upload is successful, the app id of the app will be stored in an environment variable, "BROWSERSTACK_APP_ID" and it can be accessed in your tests in the following way :
String app = System.getenv("BROWSERSTACK_APP_ID"); // Get the app id from environment variable. capabilities.setCapability("app", app); // Use the app id in the app capability in your test.