Is there a way to start adb shell from application/java code? I have followed below method. But everytime it only shows "device not found". However am able to get the logs if am executing "adb logcat -f /storage/emulated/0/logs.txt &" .I have even enabled USB debugging on the device. Kindly help me if any1 knows any other alternative.
try{
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec("adb shell");
}
catch(Exception e){
}