Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I Turn on/off Accessibility through appium using javascript

I have this adb shell command for android and tried with the terminal and it's working perfectly.

But not sure how to use this in a framework using appium command.

// disable
adb shell settings put secure enabled_accessibility_services com.android.talkback/com.google.android.marvin.talkback.TalkBackService

// enable
adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService
like image 394
J.Adhikari Avatar asked Nov 06 '22 23:11

J.Adhikari


1 Answers

I am able to use abd command in java in the following way. Hope its helps you too.

String disable= "adb shell settings put secure enabled_accessibility_services com.android.talkback/com.google.android.marvin.talkback.TalkBackService"
String enable = "adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService"
try{
       Runtime.getRuntime().exec(disable); //to disable
   //    Runtime.getRuntime().exec(enable);  //to enable
}catch(Exception e){
      e.printStackTrace();
}
like image 85
Suban Dhyako Avatar answered Nov 14 '22 03:11

Suban Dhyako