import io.appium.java_client.AppiumDriver; public class Main { public void test(AppiumDriver driver){ System.out.println("execute custom script"); driver.findElementByXPath("//android.widget.Button[contains(@text,'始终允许')]").click(); } }