I wrote a simple Java-TestNG project in which the desired capabilities are

{
    URL url = new URL("http://127.0.0.1:4724/wd/hub");
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "ANDROID");
    
        caps.setCapability("appPackage", "com.xxx.xyz");
        caps.setCapability("appActivity", "com.xxx.xyz.xyzActivity");
        driver = new AppiumDriver(url,caps);
        System.out.println("Application started");
}

But when I used the same in Appium Inspector,

{
  "platformName": "Android",
  "appPackage": "com.xxx.xyz",
   "appActivity": "com.xxx.xyz.xyzActivity"
}

I am getting pop up with this text

Invalid or unsupported WebDriver capabilities found ("appPackage", "appActivity"). Ensure to only use valid W3C WebDriver capabilities

2

There are 2 best solutions below

0
On

The problem got resolved when I entered the same configuration as in the Java-TestNG program in to Appium Inspector, which is

{
  "platformName": "Android",
  "appPackage": "com.xxx.xyz",
   "appActivity": "com.xxx.xyz.xyzActivity"
}

The Appium Inspector started working fine. Some how Appium Inspector did not like this configuration,

{
  "platformName": "Android",
  "appPackage": "com.xxx.xyz",
  "platformVersion": "9",
   "udid": "ce091xxx21c6c0c7e",
   "deviceName": "SM 950UI",
   "appActivity": "com.xxx.xyz.xyzActivity"
}
0
On

The issue could be you might have started the appium inspector without specifying the remote path so it is picking up the default path which is "/" Define the remote path as "/wd/hub". This solution worked for me.