Merged
Conversation
mdshakib007
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Bug Fix
PR Checklist
Overview
This PR resolves an issue where the
uiautomator dumpcommand execution via ADB was crashing the session when an active Appium driver was present for the device.The fix introduces logic across three modified files to prioritize using the existing Appium driver's
page_sourceproperty to capture the UI XML hierarchy instead of relying on ADB commands.Apps/Mobile/Android_Inspector_ZeuZ.py: Thecapture_ui_dumpfunction now attempts to fetchpage_sourcefrom an available Appium driver. If the driver is present and successfully retrieves the source, the ADB fallback (uiautomator dump) is skipped entirely, preventing the crash.Framework/Built_In_Automation/Mobile/Android/adb_calls/adbOptions.py: Thecheck_if_device_is_unlockedfunction is updated to check for an associated Appium driver (based on serial or absence of serial) before executingadb exec-out uiautomator dump. If a driver is found,appium_driver.page_sourceis used instead of the ADB command.server/mobile.py: A new helper function,get_appium_driver_for_serial, is introduced to centralize logic for finding the correct Appium driver instance based on device serial or globally. This helper is used to updatefetch_xml_and_screenshotandcapture_ui_dumpendpoints to use the Appium driver if available, thereby avoiding the problematic ADB call.The core rationale is: If appium_driver is available, don't call uiautomator, otherwise it will crash.
Test Cases