Steps:
1. Obtain the BrowserStack Credentials

2. Upload your APK/IPA file on BrowserStack to obtain the App URL 

3. Using Inspect App on Real Devices using BrowserStack with Appium Desktop


1. Obtain the BrowserStack Credentials

You need a BrowserStack Account for inspecting Apps using this method. If you don't have a BrowserStack Account already, please contact Support to obtain a BrowserStack Account. You will get the BrowserStack username and API key.


2. Upload your APK/IPA using the cURL Command

curl -u "username:api_key" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@/path/to/app/file/Application-debug.apk"

Replace the username, api_key, and the file path with the Browserstack username, api_key, and the location of the apk file, respectively.


The cURL request returns the App URL for the uploaded app which can be used in the Appium Inspector.

{ "app_url":"bs://<hashed appid>" }

3. Using Appium to Inspect Apps on BrowserStack Cloud

Appium Inspector is a component of the Appium Desktop application that allows us to inspect mobile Apps.

You can install it from here - Github Appium Desktop Repository


On opening the Appium Desktop Client, it will look as shown below:


1. From the Appium Welcome Screen shown above, click on the File > New Session Window(for Windows) or Appium > New Session Window(for Mac) to start a new session.


2. Select the BrowserStack tab and enter your BrowserStack Username & API Key.


3. Enter the minimum Desired Capabilities for connecting to a cloud device on BrowserStack as given below:

Desired Capabilities

There are a set of bare minimum Desired Capabilities we need to add in order to inspect an Android/iOS App using the Inspector.


Desired Capabilities for Android/iOS

  • device: Please use the allotted device name "Samsung Galaxy S9".
  • os_version: Please use the allotted OS Version "8.0".
  • app: The URL of the uploaded App.
{
  "device": "Samsung Galaxy S9",
  "os_version": "8.0",
  "app": "bs://app_url"
}

The above capability set allocates a device of the selected configuration dynamically from the available cloud devices.


4. Finally, click on the Start Session.


Thus, we have successfully started an Appium Desktop Inspector session for inspecting your Mobile App on using devices on TestObject Cloud.

Check the below article to know more about inspecting Android/iOS Apps using Appium Inspector - How to inspect Android/iOS Apps using Appium Inspector?

Happy Automation!