Skip to content

Commit 142d38c

Browse files
committed
ios app installation check code updated
1 parent 652d702 commit 142d38c

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

server/mobile.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,14 @@ def handle_ios_app_install(filename: str, sim_udid: str):
655655

656656

657657
@router.get("/ios/bundle-installed")
658-
def is_ios_app_installed(sim_udid: str, bundle_id: str) -> bool:
659-
result = subprocess.run(
660-
["xcrun", "simctl", "get_app_container", sim_udid, bundle_id],
661-
stdout=subprocess.PIPE,
662-
stderr=subprocess.PIPE,
663-
text=True,
664-
)
665-
return result.returncode == 0
658+
def is_ios_app_installed(sim_udid: str, bundle_id: str):
659+
try:
660+
result = subprocess.run(
661+
["xcrun", "simctl", "get_app_container", sim_udid, bundle_id],
662+
stdout=subprocess.PIPE,
663+
stderr=subprocess.PIPE,
664+
text=True,
665+
)
666+
return {"installed": result.returncode == 0}
667+
except Exception as e:
668+
return {"installed": False, "error": str(e)}

0 commit comments

Comments
 (0)