Sauce Labs Customer Idea Portal

Submit an idea and make Sauce Labs even better!

Support for adb commands

We need support to run adb commands for the tests running in Sauces. Right now we are able to run adb commands using Runtime.getRuntime().exec("command") in local environment using appium and any android emulator. We need help to pass adb commands to Sauce as well.

  • Guest
  • Apr 11 2016
  • Will not implement
  • Attach files
  • Shabana Parveen commented
    8 Jun, 2017 10:09am

    Hello @chiarng, In saucelab env. Keyboard isn’t always hidden in Android while using appium. for this I just wanted to try below procedure, might be it works for me as I tried all. but below producer is not working on saucelab as it shows "cannot run adb program". Please suggest if you have another way-out to resolve keyboard hiding issue.

    Process p = Runtime.getRuntime().exec("adb shell dumpsys input_method | grep mInputShown");

        BufferedReader   in = new BufferedReader(new InputStreamReader(p.getInputStream()));

        String outputText = "";

          while ((outputText = in.readLine()) != null) {

              if(!outputText.trim().equals("")){

                        String keyboardProperties[]=outputText.split(" ");

                        String keyValue[]=keyboardProperties[keyboardProperties.length-1].split("=");

                        String softkeyboardpresenseValue=keyValue[keyValue.length-1];

                        if(softkeyboardpresenseValue.equalsIgnoreCase("false")){

                                isKeyboardPresent=false;

                        }else{

                                isKeyboardPresent=true;

                                ((PressesKeyCode) driver).pressKeyCode(AndroidKeyCode.BACK);

                        }

               }

           }

           in.close();

    }

    Thanks,

    Shabana Parveen

  • Santosh Raghavan commented
    20 Jan, 2017 08:06pm

    The Android emulator does not have any Photos in the Camera Roll. So Can't Pick a Photo from Camera (Surprised! since this is a basic feature that almost every Mobile app supports)

     

    Only work around existing is use adb command to copy and broadcast images. So literally hit a dead lock since SauceLabs won't give permission to execute adb commands.

  • Chiarng Lin commented
    14 Apr, 2016 01:28am

    Sauce Labs cannot provide support for adb commands because that would necessitate a deviation from our Appium strategy. Appium itself uses adb to "control" emulators, but does not give you the ability to inject adb commands directly while running a test. The Appium team has considered this request in the past, but prefer to build the functionality that users are trying to execute with adb into Appium capabilities instead. My suggestion would be to submit a PR to the Appium project to get the functionality you want in.