iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 29
0
Mobile Development

宅經濟起飛,想當顆沙發馬鈴薯嗎??智慧電視會是未來的趨勢嗎??讓我們一探 Android TV 的神秘世界系列 第 29

Day 29 - 上架 App 到 Google Play Store for Android TV Part 2

昨天成為 Android TV 開發者後
我們可以來上架啦

因為這次鐵人賽的資料來源來自威秀影城
版權的關係我另新開一個專案來示範上架

大家可以用自己的專案來練習上架喔
上架前必須先檢查自己的 App 是否符合 Google Play Store for Android TV 的規範
可以參考這篇官方文件<<發佈到 Android TV 平台>>

LEANBACK_LAUNCHER

首先確認 AndroidManifest.xml 裡的起始 Activity,<category>的部分是否為 LEANBACK_LAUNCHER

<activity android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    </intent-filter>
</activity>

Android TV 不應該是觸控螢幕

官方文件提到

Your app must declare that it does not require a touchscreen. The manifest must declare the android.hardware.touchscreen hardware with android:required="false". Learn more about declaring hardware requirements.

因為目前電視盒及 Android TV 都是用遙控器來操作沒有觸控,因此會需要加上這個條件
一樣在 AndroidManifest.xml 裡 <application> 外加上以下片段

<uses-feature android:name="android.hardware.touchscreen"
        android:required="false"/>

打包簽名 APK

  1. 點擊 Toolbar 上的 Build -> Generate Signed Bundle / APK...
    https://ithelp.ithome.com.tw/upload/images/20201014/201071656zLKF3ulvz.png
  2. 選擇下面 APK -> Next
    https://ithelp.ithome.com.tw/upload/images/20201014/201071656WxZN5P5ow.png
  3. 如果已經有 Key Store 的可以直接載入,這邊會重新教學如何產生 Key Store,點擊 Create new...
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165AhF3E8dFlv.png
  4. 選擇你 Key Store 的存放資料夾 -> OK
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165YM4jQ9hIMn.png
  5. 輸入 Key Store 的資訊
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165jb6KAdsus9.png
    • 第一個密碼是開啟 Key Store 的密碼
    • 第二個是密鑰的密碼
    • Alias 是別名,沒有硬性規定,喜歡什麼填什麼
    • Validity (years) 是指 Key Store 的年限,一旦 App 上架了,到下架前都要用這把 Key Store 所以年限通常都會拉久一點
    • 下面就是一些基本資料,把它填一填
    • 填完按下 OK
  6. 創建完 Key Store 後回到剛剛頁面會自動幫你填入,如果你懶的記就勾選 Remember passwords 吧 -> Next
    https://ithelp.ithome.com.tw/upload/images/20201014/201071653KdEGvlyIM.png
  7. 因為是要上 Google Play Store 的,請在 Build Variants 的選單中點選 release 下方的 Signature Versions 要把兩個都勾上,否則上架時會出錯,選好之後點擊 Finish
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165dVRyHld2cx.png
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165EemwuQFXok.png
  8. 等帶進度條跑完
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165nMOoJTloqH.png
  9. APK就完成打包囉
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165qr8RwzvlIm.png

Google Play Console

  1. 進到 Google Play Console 並點選 前往 Play 管理中心
  2. 在所有應用程式頁籤中點選右方建立應用程式
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165RzLS0I4bWu.png
  3. 填寫應用程式詳細資料,包括應用程式名稱預設語言應用程式或遊戲 等內容,填寫完畢後點選右下方 建立應用程式
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165664cY1PxV3.png
  4. 接著在左側選單 正式版 中點選右上方 建立新版本
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165vAsEhnkxxn.png
  5. 將剛剛打包好的 APK 上傳上來
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165S66LHfbL4f.png
  6. 上傳成功後下方版本詳細資訊會自動帶入,接著填入版本資訊等內容,按下儲存
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165s8KjwPZYDb.png
  7. 按下儲存後會右下方會變成 Focus 在 檢查版本,給他點下去
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165xAMy2zRoa6.png
  8. 接下來 Google Play Console 會檢查你的商店資訊和 APK 相關資訊。那這邊因為我們第一次新建應用程式,所以還有一些地方需要完成,所以依照提示點擊 前往資訊主頁
    https://ithelp.ithome.com.tw/upload/images/20201014/20107165WvZzQ0lPcE.png
  9. 把該填的填一填,準備送審囉

小插曲 (2023/09/21 更新)

上方提到的官方文件<<發佈到 Android TV 平台>> ,提到了幾項必須宣告為不支援的 user-feature,如下圖
https://ithelp.ithome.com.tw/upload/images/20230921/20107165gnY0iudphl.png
但底下的範例卻沒提到,Google 小編加加油 XD
https://ithelp.ithome.com.tw/upload/images/20230921/201071651SL8mDMwrF.png
記得加上去避免送審被 reject 唷


上一篇
Day 28 - 上架 App 到 Google Play Store for Android TV Part 1
下一篇
Day-30 最後一天啦!!!鐵人賽心得
系列文
宅經濟起飛,想當顆沙發馬鈴薯嗎??智慧電視會是未來的趨勢嗎??讓我們一探 Android TV 的神秘世界30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言