I want to publish multiple apks: one for mobile and other androidtv within same application. As per Publishing Multiple APKs with Different Filters there are only four distinguishing filters within same application:
Currently, Google Play allows you to publish multiple APKs for the
same application only when each APK provides different filters based
on the following configurations:
OpenGL texture compression formats
Screen size (and, optionally, screen density)
CPU Architecture (ABI)
All other filters still work the same as usual, but these four are the
only filters that can distinguish one APK from another within the same
application listing on Google Play. For example, you cannot publish
multiple APKs for the same application if the APKs differ only based
on whether the device has a camera.
There actually is a "feature" that is used to specifically target Android TV. You can view the instructions in the docs. But basically you just have to specify that it uses the
leanback feature like below.
<manifest> <uses-feature android:name="android.software.leanback" android:required="true" /> ... </manifest>
This will ensure that any TV device running leanback will get your APK (you can set required=false if you're using one APK). I believe that all official Android TVs are using this feature. It's possible leanback can be on a non-tv device, but in that case all of their apps will be showing up as TV apps.
One thing to note is that there are some overlapping devices that both your mobile and TV APK may satisfy. After speaking with a rep on the Play Console team, they recommended the way to get around it:
Regarding the multi-apk scenario where you have overlapping devices - yes, your Android TV APK would always need to have a higher version code. There are a few options to help resolve this:
You can manually blacklist the 2 overlapping devices. This would immediately resolve the issue with overlapping APKs, however if new devices are released in the future that are eligible for both APKs you would face this issue again.
Use a version code scheme for your Android TV APK that is significantly higher than your mobile device APK. For example, your TV APK can be existing version code + 100000, or 100808, while your mobile device APK remains at 838. In this scenario, you could publish mobile device APKs up to version code 100808 without having to update your Android TV APK with every push. This would also resolve any issues with Alpha/Beta testing Android TV APKs.
His response is also covered in the "Assigning version codes" section of this doc.