Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run shell sortcut for android #732

Merged
merged 2 commits into from
Dec 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/appium_lib/android/android.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative 'common/helper'
require_relative 'common/command/command'

require_relative 'element/alert'
require_relative 'element/button'
Expand All @@ -17,6 +18,7 @@ module Android
class Bridge
def self.for(target)
target.extend Appium::Android
target.extend Appium::Android::Command
end
end
end
Expand Down
21 changes: 21 additions & 0 deletions lib/appium_lib/android/common/command/command.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions lib/appium_lib/android/espresso/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/appium_lib/android/uiautomator2/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down