Forum Discussion

vikram_u_k's avatar
vikram_u_k
Contributor
8 years ago
Solved

Get the Response from Commandline

Hi, With TestComplete Android using python, i am trying to get the Date from one of the connected Systems to get the System date   Testedapp is linked to ADB exe:     TestedApps.adb.Params.Activ...
  • HKosova's avatar
    8 years ago

    Hi Vikram,

     

    To run ADB shell commands on an Android device, you should use the Device.ShellExecute method:

    def Test():
      Mobile.SetCurrent("emulator-5554")
      strDate = Mobile.Device().ShellExecute("date") # Do not prefix commands with "adb shell"
    
      Log.Message(strDate)

    # Result:
    # Thu May 26 11:56:37 GMT 2016