Yes, You can Create a class called ADB In ADB class …following are the methods u can create.
1)Check whether Android Home is available on System environment.
2)Check the OS part
3)Execute the command
4)In command prompt pass Commad + Device id
public static String Get_Android(){
if(Android_Home==null ) {
Android_Home=System.getenv("Android_Home");
if(Android_Home==null) throw new RuntimeErrorException("Failed to find android home","Make sure environment variable is set");
}
return Android_Home;
}
public static String getos(){
if(os==null) os= System.getenv("os.name");
return os;
}
public static boolean iswindows(){
return getos().startsWith("Windows");
}
//*****************************************************Run command *******************************************88
public static String runcommand(String command){
String output=null;
try{
Scanner scan = new Scanner(Runtime.getRuntime().exec(command).getInputStream()).useDelimiter("//A");
}
catch (IOException e){
throw new RuntimeException(e.getMessage());
}
return output;
===============================