Forum Discussion

Keith_S's avatar
Keith_S
New Contributor
5 days ago

How to retrieve device ID in run-tests script

Hello. I have tests working on BitBar for both iOS and Android with Appium and AltTester by manually uploading the run-tests script and app build. When doing this manually, I know the device that the test will run on, so I know what capabilities file I need to use ahead of time when initializing AppiumDriver.

However, I'm integrating our tests now to run via a Jenkins pipeline. The device(s) to be run on is chosen from the Jenkins pipeline and can change from run to run. This means that my tests need to dynamically discover which device the test is being run on, so that it can then load the correct capabilities file.

Is there a way to find out which device the test will be run on from within the run-tests script prior to launching the test with maven? I realize that I could probably use "xcrun xctrace list devices" or "adb devices", but that's a little bit messy. I was hoping there is a better way to do this that BitBar supports.

Alternatively, is it possible to retrieve a set of capabilities for the device that the test will be run on, from within the run-tests script?

Thank you

No RepliesBe the first to reply