Control Automotive Sessions in CarPlay and Android Auto
Digital.ai Testing allows you to explicitly control automotive projection sessions during test execution using script commands. This is useful when testing applications that integrate with:
- Apple CarPlay (iOS)
- Android Auto (Android)
You can dynamically start and stop automotive sessions within your test flow instead of relying on automatic session initialization.
Overview
| Command | Description |
|---|---|
automotive.start | Initializes and activates an automotive session. |
automotive.stop | Terminates and cleans up the automotive session. |
-
Known Issue: Invoking
automotive.startcommand multiple times within the same test session is not supported on iOS 26.1 and 26.0.1. -
Executing the command multiple times sequentially may cause the test to fail or behave unexpectedly.
When to Use This Feature
- You need manual control over automotive sessions
- Your test requires starting/stopping projection mid-execution
- You are not using the
automotiveProjectioncapability
If the session is already configured with the automotiveProjection capability, these commands cannot be used and will result in an error.
automotive.start
The automotive.start command launches the supported automotive environment, such as Android Automotive or Apple CarPlay, and opens the specified automotive application.
Use this command before performing interactions or validations in an automotive environment.
driver.executeScript("digitalai:automotive.start", resolution, clusterContent);
Parameters
| Parameter | Description |
|---|---|
resolution | Specifies the display resolution for the automotive interface. For example, 800x480. |
clusterContent | Specifies the instrument cluster content type to launch. For example, Map. |
The clusterContent parameter is optional and is supported only on iOS devices. For more information, see Instrument Cluster Support.
Example
driver.executeScript("digitalai:automotive.start", "800x480", "Map");
automotive.stop
The automotive.stop command ends the automotive session and returns the device to its standard operating mode.
Use this command after completing automotive test execution.
Parameters
This command does not accept any parameters.
Example
driver.executeScript("digitalai:automotive.stop");
This example stops the automotive interface after test execution is complete.
Always call the automotive.stop after completing automotive testing to ensure the automotive environment is closed properly.