Skip to content

Commit 5fc025f

Browse files
authored
Merge pull request #440 from AutomationSolutionz/ios_bundle_id
ios app can be launched using bundle id
2 parents cc27a97 + 3c640f1 commit 5fc025f

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

Framework/Built_In_Automation/Mobile/CrossPlatform/Appium/BuiltInFunctions.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -869,17 +869,21 @@ def start_appium_driver(
869869
# saving simulator path for future use
870870
Shared_Resources.Set_Shared_Variables("ios_simulator_folder_path", str(app))
871871

872-
app = os.path.join(app, ios)
873-
encoding = "utf-8"
874-
bundle_id = str(
875-
subprocess.check_output(
876-
["osascript", "-e", 'id of app "%s"' % str(app)]
877-
),
878-
encoding=encoding,
879-
).strip()
880-
881-
desired_caps["app"] = app # Use set_value() for writing to element
882-
desired_caps["bundleId"] = bundle_id.replace("\\n", "")
872+
ios_part = ios.split('.')[0]
873+
if ios_part == 'com':
874+
desired_caps["bundleId"] = ios
875+
else:
876+
app = os.path.join(app, ios)
877+
encoding = "utf-8"
878+
bundle_id = str(
879+
subprocess.check_output(
880+
["osascript", "-e", 'id of app "%s"' % str(app)]
881+
),
882+
encoding=encoding,
883+
).strip()
884+
885+
desired_caps["app"] = app # Use set_value() for writing to element
886+
desired_caps["bundleId"] = bundle_id.replace("\\n", "")
883887

884888
desired_caps["platformName"] = "iOS" # Read version #!!! Temporarily hard coded
885889
desired_caps["platformVersion"] = platform_version

0 commit comments

Comments
 (0)