Convert your project to Maven project and use the surefire plugin. Inside the plugin mention the testng.xml file as the test suite. Now you can run your scripts in any environment using below commands.
mvn install - This will install all the dependencies
mvn test - This will run your scripts
You can scroll till you don’t find element with given resource id. This can be achieved with UiAutomator2as automation engine. You need to use automation name as UiAutomator2 in desires capabilities.
Add in desired capability UiAutomator2 if you are using appium as automation engine.