Reputation: 1195
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:
How can I run an Android Automotive OS app from Android Studio?
Upvotes: 3
Views: 1231
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:
Upvotes: 5