Oscar Wahltinez
Oscar Wahltinez

Reputation: 1195

How can I run an Android Automotive OS app from Android Studio?

I am trying to run an Android Automotive OS app in the emulator from Android Studio.

When open an Android Automotive OS project in Android Studio and click on the run button, I get the following error: Error running 'automotive': Default Activity not found. The run configuration of Android Studio also displays this warning:

Default Activity not found

How can I run an Android Automotive OS app from Android Studio?

Upvotes: 3

Views: 1231

Answers (1)

Oscar Wahltinez
Oscar Wahltinez

Reputation: 1195

App's in Android Automotive OS don't get launched the traditional way; instead your app should be prepared to react to intents as the main entry point, in addition to providing services such as MediaBrowserService when appropriate. For example, these are actions your app might be handling via intent filters such as android.intent.action.ACTION_APPLICATION_PREFERENCES.

To launch your app, you need to install it first and then start it from the launcher in Android Automotive OS. You can install it via ADB or you can modify Android Studio's launch configuration to only install the APK without trying to launch it. Under Launch options, select Nothing for the Launch target:

Launch nothing option

Upvotes: 5

Related Questions