Initialize application session
(self)
| 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""" |
no test coverage detected