We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b707063 commit 460699cCopy full SHA for 460699c
lib/appium_lib/common/helper.rb
@@ -220,9 +220,11 @@ def tag tag_name
220
# Lists package, activity, and adb shell am start -n value for current app.
221
# Works on local host only (not remote).
222
def current_app
223
- line = `adb shell dumpsys window windows`.each_line.grep(/mFocusedApp/).first
224
- puts line
+ line = `adb shell dumpsys window windows`.each_line.grep(/mFocusedApp/).first.strip
225
pair = line.split(' ').last.gsub('}','').split('/')
226
- { package: pair.first, activity: pair.last, am_start: pair.first + '/' + pair.last }
+ OpenStruct.new line: line,
+ package: pair.first,
227
+ activity: pair.last,
228
+ am_start: pair.first + '/' + pair.last
229
end
230
end # module Appium::Common
0 commit comments