gdogaru
gdogaru

Reputation: 521

Prevent android wear app from being installed on phone

I have an android app with a wear dependent application.

When I run gradlew installDebug in the root folder, with my phone connected, gradle first installs the mobile app on the phone, then the wear app on the phone.

Since it's the same package name, the mobile app gets overwritten and the wear app can not be run on a phone.

Is there a way to make installDebug fail for a subproject if a suitable device is not found, and install it only on the devices that support wear or phone?

Upvotes: 0

Views: 76

Answers (1)

Kuffs
Kuffs

Reputation: 35661

Add this to your manifest for the Wear app

<uses-feature android:name="android.hardware.type.watch" />

https://developer.android.com/guide/topics/manifest/uses-feature-element.html#hw-features

Upvotes: 0

Related Questions