Unable to execute native application on Android devices in Parralel

Hello,

I am unable to launch the application with two Android devices.
Steps:

  1. In Windows Machine, i have installed Appium.exe.
  2. Opened two Appium session with different port numbers.
  3. Set the capabilities using Java Code.
  4. Create two threads and call the created capabilities method with different port.
  5. Some time the application launch in a both the devices or some time only in one . Ratio of the device running in both device to one device is 30 : 70.
    Details of the devices connected with port are mentioned below :
  • Maximum it working with port 4723(90%).
  • I have used the port number 4720.its maximum fail.
  1. When Appium fails to launch the application in multiple devices then Appium gets hangs . The error received in Appium is mentioned below:

    info: Starting App
    debug: Attempting to kill all ‘uiautomator’ processes
    debug: Getting all processes with ‘uiautomator’
    debug: executing: “C:\android-sdk\platform-tools\adb.exe” -s b0132538 shell “ps ‘uiautomator’”
    debug: No matching processes found
    debug: Running bootstrap
    debug: spawning: C:\android-sdk\platform-tools\adb.exe -s b0132538 shell uiautomator runtest AppiumBootstrap.jar -c
    io.appium.android.bootstrap.Bootstrap
    debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
    debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
    debug: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
    debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
    debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
    debug: [BOOTSTRAP] [debug] Socket opened on port 4724
    debug: [BOOTSTRAP] [debug] Appium Socket Server Ready
    debug: [BOOTSTRAP] [debug] Loading json…
    debug: Waking up device if it’s not alive
    debug: Pushing command to appium work queue: [“wake”,{}]
    debug: [BOOTSTRAP] [debug] json loading complete.
    debug: [BOOTSTRAP] [debug] Registered crash watchers.

Note: If i execute one by one, its working fine.

Thanks & Regards,
Paras Jain

I’m not sure how to do this with the GUI application. You need to start two different Appium servers, each on different ports and talking to different devices. See the note in Platform Support and, if you’d like, in the discussion of Selenium Grid.

Hey isaac,

I am opening two different Appium server, using command: appium -bp “number”.

But Appium always opened bootstrap port on 4724. Below is the logs:

debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
debug: [BOOTSTRAP] [debug] Socket opened on port 4724
debug: [BOOTSTRAP] [debug] Appium Socket Server Ready.

I think problem is with bootstrap port if i am right than my question is how i will open two different bootstrap ports?

Thanks and Regards,
Paras Jain

Are you setting a separate communications port for the different Appium servers using:

–port [portnumber]

The bootstrap port is just for the port that the appium server is using to communicate to the test device, so if you have two Appium servers which are both listening on the same port, you would probably get very inconsistent results.

The other thing that I’ve noticed is that JSON configurations are not necessarily obeyed - particularly for things like ports, I find that setting things via command line flags is much more reliable than setting via JSON config.

-Hank