Platform: Android
Appium v1.5.2
Windows
I am starting the Appium server using the following command on Windows, passing the udid value:
appium -a %APPIUM_SERVER% -p %APPIUM_SERVER_PORT% -bp %BOOTSTRAP_PORT% --chromedriver-port %CHROME_DRIVER_PORT% --chromedriver-executable %CHROME_DRIVER_EXEC% --platform-name Android --default-capabilities “{“udid”:“192.168.56.102:5555”}”
I also tried using the --udid flag, which is deprecated in v1.5.2 according to docs. Either way, the server doesn’t use the udid value I am passing in (i.e., 192.168.56.102:5555). It always uses the first device from the “adb devices” command (i.e., 192.168.56.101:5555). Here is the log snippet:
c:\QA\mobile>appium -a 10.21.2.124 -p 4721 -bp 4821 --chromedriver-port 4921 --chromedriver-executable S:\bin\chromedriver.exe --platform-name Android --default-capabilities “{“udid”:“192.168.56.102:5555”}”
[Appium] Welcome to Appium v1.5.2
[Appium] Non-default server args:
[Appium] address: ‘10.21.2.124’
[Appium] port: 4721
[Appium] bootstrapPort: 4821
[Appium] chromeDriverPort: 4921
[Appium] chromedriverExecutable: ‘S:\bin\chromedriver.exe’
[Appium] defaultCapabilities: { udid: ‘192.168.56.102:5555’, platformName: ‘Android’ }
[Appium] platformName: ‘Android’
[Appium] Deprecated server args:
[Appium] --platform-name => --default-capabilities ‘{“platformName”:“Android”}’
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium] udid: ‘192.168.56.102:5555’
[Appium] platformName: ‘Android’
[Appium] Appium REST http interface listener started on 10.21.2.124:4721
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:“Chrome”,“platformName”:“Android”,“deviceName”:“whatever”,“udid”:null,“autoAcceptAlerts”:true}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“browserName”:“Chrome”,“platformName”:“Android”,“deviceName”:“whatever”,“udid”:null,“autoAcceptAlerts”:true},null,null,null]
[Appium] Creating new AndroidDriver session
[Appium] Capabilities:
[Appium] browserName: ‘Chrome’
[Appium] platformName: ‘Android’
[Appium] deviceName: ‘whatever’
[Appium] udid: null
[Appium] autoAcceptAlerts: true
[BaseDriver] The following capabilities were provided, but are not recognized by appium: autoAcceptAlerts.
[BaseDriver] Session created with session id: 49720c16-784e-44c0-8a39-9bda315db0f7
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_91
[AndroidDriver] We’re going to run a Chrome-based session
[AndroidDriver] Chrome-type package and activity are com.android.chrome and com.google.android.apps.chrome.Main
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Android\android-sdk\platform-tools\adb.exe
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 2 device(s) connected
[AndroidDriver] Using device: 192.168.56.101:5555
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Android\android-sdk\platform-tools\adb.exe
[debug] [ADB] Setting device id to 192.168.56.101:5555
Notice I am intentionally not passing the udid from my client capability. I was hoping the server would use the value I pass in from the default capability. You see in the log that the server acknowledges the udid I am passing in via command line, but it doesn’t use it.
Am I doing something wrong? Or is this a bug? Thanks