Get a unique device name for the current worker. Uses the base device name and appends the port number for uniqueness.
()
| 38 | |
| 39 | |
| 40 | def android_device_name() -> str: |
| 41 | """ |
| 42 | Get a unique device name for the current worker. |
| 43 | Uses the base device name and appends the port number for uniqueness. |
| 44 | """ |
| 45 | prefix = os.getenv('ANDROID_MODEL') or 'Android Emulator' |
| 46 | worker_info = get_worker_info() |
| 47 | |
| 48 | if worker_info.is_parallel: |
| 49 | # For parallel execution, we can use different device names or ports |
| 50 | # This is a simplified approach - in practice you might want to use different emulators |
| 51 | return f'{prefix} - Worker {worker_info.worker_id}' |
| 52 | |
| 53 | return prefix |
no test coverage detected