We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8a0110 commit 683ae29Copy full SHA for 683ae29
lib/appium_lib/common/helper.rb
@@ -216,4 +216,13 @@ def find_names name
216
def tag tag_name
217
find_element :tag_name, tag_name
218
end
219
+
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
225
+ pair = line.split(' ').last.gsub('}','').split('/')
226
+ { package: pair.first, activity: pair.last, am_start: pair.first + '/' + pair.last }
227
+ end
228
end # module Appium::Common
0 commit comments