Path to app file

Hello I have difficulty to set capability to app location. In my case app located in /user/apk/debug/appname-v1.2.3.apk
File name and path is hardcoded and every time after new app version is released I need to change app name in my code.
Maybe someone know how to write patch to select any apk file in the directory.( p,s. /user/apk/debug/*.apk doesn’t work) and I’m writing it with java.

add apk to your project directory and access it by using File in java, if you don’t understand me please send write here your code and i will edit it.

It’s possible to do this if my app and appium test are running on jenkins?

I run my tests with Java/Selenium and Jenkins. The Java code refers to the file path of the apk I want. As long as the file path is contained in the Jenkins workspace, there isnt a difference between using a build server or an IDE to execute. The Jenkins server kicks off the Java execution and that code loads in the apk for appium… You could have part of your Jenkins build rename your target apk to something generic via the command line before it executes tests.

sure, you are access on your directory and this will not affect it, but don’t use the path from your machine should use it from project

Ex:capabilities.setCapability(“app”, new File(“src/test/resources/Builds/your.apk”));