MCPcopy Create free account
hub / github.com/browser-use/macOS-use / initialize

Method initialize

mlx_use/mac/context.py:69–77  ·  view source on GitHub ↗

Initialize application session

(self)

Source from the content-addressed store, hash-verified

67 await self.close()
68
69 async def initialize(self):
70 """Initialize application session"""
71 logger.info(f'Initializing Mac app context for {self.config.bundle_id}')
72 pid = await self._get_app_pid()
73
74 if not pid:
75 raise RuntimeError(f'Failed to launch/find app with bundle ID {self.config.bundle_id}')
76
77 self.session = MacAppSession(pid=pid, tree_builder=MacUITreeBuilder(), observer=self._setup_observer(pid))
78
79 def _setup_observer(self, pid: int) -> objc.objc_object:
80 """Set up accessibility observer for UI changes"""

Callers 1

__aenter__Method · 0.95

Calls 4

_get_app_pidMethod · 0.95
_setup_observerMethod · 0.95
MacUITreeBuilderClass · 0.90
MacAppSessionClass · 0.85

Tested by

no test coverage detected