1

I need to validate few status of the android device. Can any one let me know how to extract the information from adb dumpsys and validate the responses using Java. Your help is much appreciated.

Ex: 'adb shell dumpsys battery' this code when android device is connected to windows gets executed and will fetch the response. can someone help me how to extract the information from response and validate the same.

1 Answer 1

0
    Map<String, Object> argv = new HashMap<>();
    argv.put("command", "dumpsys ");
    argv.put("args", Lists.newArrayList("battery"));
    String result = ((AppiumDriver) driver).executeScript("mobile: shell", argv).toString();
    System.out.println(result);
1
  • Welcome to SQA Stack exchange! You answer could be much better if you were to add some explanation to your code.
    – Kate Paulk
    Dec 14, 2022 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.