Skip to main content

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

CommandDescription
automotive.startInitializes and activates an automotive session.
automotive.stopTerminates and cleans up the automotive session.
info
  • Known Issue: Invoking automotive.start command 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 automotiveProjection capability
info

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

ParameterDescription
resolutionSpecifies the display resolution for the automotive interface. For example, 800x480.
clusterContentSpecifies the instrument cluster content type to launch. For example, Map.
note

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.

info

Always call the automotive.stop after completing automotive testing to ensure the automotive environment is closed properly.