diff --git a/CHANGELOG.md b/CHANGELOG.md index fba071ed..ab9fb198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ Commit based release not is [release_notes.md](./release_notes.md) Release tags are https://github.com/appium/ruby_lib/releases . +## v9.8.2 +### 1. Enhancements +- add `shell` command wrapped `mobile: shell` for Android [] + +### 2. Bug fixes + +### 3. Deprecations ## v9.8.1 ### 1. Enhancements diff --git a/lib/appium_lib/android/android.rb b/lib/appium_lib/android/android.rb index 37452361..84695fde 100644 --- a/lib/appium_lib/android/android.rb +++ b/lib/appium_lib/android/android.rb @@ -1,4 +1,5 @@ require_relative 'common/helper' +require_relative 'common/command/command' require_relative 'element/alert' require_relative 'element/button' @@ -17,6 +18,7 @@ module Android class Bridge def self.for(target) target.extend Appium::Android + target.extend Appium::Android::Command end end end diff --git a/lib/appium_lib/android/common/command/command.rb b/lib/appium_lib/android/common/command/command.rb new file mode 100644 index 00000000..5515c286 --- /dev/null +++ b/lib/appium_lib/android/common/command/command.rb @@ -0,0 +1,21 @@ +module Appium + module Android + module Command + # Conduct an adb shell script on Appium server. + # Require `--relaxed-security` arguments when run Appium server as server side arguments. + # + # @param [String] command Command for "adb shell" + # @param [Array] arguments Arguments for the adb command + # + # @example + # + # shell "echo", "list" #=> "list" + # + def shell(command, arguments) + args = { command: command, args: arguments } + # --relaxed-security + @driver.execute_script 'mobile: shell', args + end + end + end +end diff --git a/lib/appium_lib/android/espresso/bridge.rb b/lib/appium_lib/android/espresso/bridge.rb index 7d36f944..ac467d81 100644 --- a/lib/appium_lib/android/espresso/bridge.rb +++ b/lib/appium_lib/android/espresso/bridge.rb @@ -6,6 +6,7 @@ module Espresso class Bridge def self.for(target) target.extend Appium::Android + target.extend Appium::Android::Command target.extend Appium::Android::Espresso end end diff --git a/lib/appium_lib/android/uiautomator2/bridge.rb b/lib/appium_lib/android/uiautomator2/bridge.rb index 7727791e..f600940b 100644 --- a/lib/appium_lib/android/uiautomator2/bridge.rb +++ b/lib/appium_lib/android/uiautomator2/bridge.rb @@ -6,6 +6,7 @@ module Uiautomator2 class Bridge def self.for(target) target.extend Appium::Android + target.extend Appium::Android::Command target.extend Appium::Android::Uiautomator2 target.extend Appium::Android::Uiautomator2::Helper target.extend Appium::Android::Uiautomator2::Element