測試 Asset Delivery
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
請按照本指南中的步驟,測試應用程式如何整合 Play Asset Delivery
擷取資產包
本機測試
Play Asset Delivery 安裝最新版本的
遊戲中使用 bundletool
。使用本機測試
快速反覆進行,不需要將遊戲上傳到 Google
Play 伺服器。您需要採取的步驟取決於您是否
以 Java、Native 或 Unity 開發
Java 或原生
在本機上測試應用程式的步驟如下:
建構應用程式套件。
使用 --local-testing
旗標產生 APK:
java -jar bundletool-all.jar build-apks --bundle=path/to/your/bundle.aab \
--output=output.apks --local-testing
連結裝置並執行 bundletool
以側載 APK:
java -jar bundletool.jar install-apks --apks=output.apks
Unity
在 Unity 編輯器中,選取 Google>建構及執行。
行為
在應用程式安裝過程中,系統將安裝 install-time
軟體包。
fast-follow
軟體包的行為與 on-demand
軟體包相同。也就是說
以便自動擷取。開發人員必須
並在遊戲開始時手動調整您不需要變更任何程式碼
限制
本機測試具有以下限制:
- 軟體包從外部儲存空間 (而非 Google Play) 擷取,因此無法測試
發生網路錯誤時程式碼的行為。
- 本機測試不涵蓋 Wi-Fi 連線等候狀況。
- 不支援更新內容。安裝新版的
手動解除安裝先前的版本
使用內部應用程式分享功能進行測試
即將發布候選版時,請盡可能使用貼近實際的設定來測試遊戲,確保正式版遊戲能帶給使用者良好的效能體驗。如要確認這一點,請使用內部應用程式分享功能取得可分享的連結,用來從 Google Play 下載遊戲,而您看到的遊戲行為,也會完全等同於遊戲發布至 Play 商店後使用者所看到的行為。
如要使用內部應用程式分享功能測試 Asset Delivery,請按照下列步驟操作:
- 建構應用程式套件。
- 按照 Play 管理中心的操作說明,
內部分享您的應用程式。
- 在測試裝置上,按一下所需版本的內部應用程式分享連結
剛剛上傳的應用程式
- 按一下 Google Play 商店頁面顯示的
連結。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Test asset delivery\n\nUse the steps in this guide to test how your app integrates Play Asset Delivery\nto retrieve asset packs.\n\nLocal testing\n-------------\n\nPlay Asset Delivery supports local testing by installing a new version of the\ngame using [`bundletool`](/studio/command-line/bundletool). Use local testing\nfor quick, iterative cycles as it avoids the need to upload the game to Google\nPlay servers. The steps you need to take depend on whether you're\ndeveloping in Java, native, or Unity.\n\n- [Java](#steps-native-java)\n- [Native](#steps-native-java)\n- [Unity](#steps-unity)\n\n### Java or native\n\nFollow these steps to test your app locally:\n\n1. [Build your app bundle](/guide/playcore/asset-delivery#next-step-instructions).\n\n2. Generate APKs with the `--local-testing` flag:\n\n ```\n java -jar bundletool-all.jar build-apks --bundle=path/to/your/bundle.aab \\\n --output=output.apks --local-testing\n ```\n3. Connect a device and run `bundletool` to sideload the APKs:\n\n ```\n java -jar bundletool.jar install-apks --apks=output.apks\n ```\n\n### Unity\n\nIn the Unity Editor, select **Google \\\u003e Build and Run**.\n\n### Behavior\n\n`install-time` packs will be installed during the app installation process.\n\n`fast-follow` packs behave as `on-demand` packs. That is, they won't be\nautomatically fetched when the game is sideloaded. Developers need to request\nthem manually when the game starts; this does not require any code changes in\nyour app.\n\n### Limitations\n\nThe following are limitations of local testing:\n\n- Packs fetch from external storage instead of Play, so you cannot test how your code behaves in the case of network errors.\n- Local testing does not cover the wait-for-Wi-Fi scenario.\n- Updates are not supported. Before installing a new version of your build, manually uninstall the previous version.\n\nTesting with internal app sharing\n---------------------------------\n\nAs you get closer to having a release candidate, test\nyour game using as realistic a configuration as possible to make sure that your game will perform\nwell for your users in production. To validate this, you can use\n[internal app sharing](https://support.google.com/googleplay/android-developer/answer/9303479)\nto get a sharable link that you can use to download the game from Play while\ngetting the exact same behaviour as your users will once the game is\npublished to the Play Store.\n\nTo test Asset Delivery using internal app sharing, do the following:\n\n1. Build your app bundle.\n2. Follow the Play Console instructions on how to [share your app internally](https://support.google.com/googleplay/android-developer/answer/9303479).\n3. On the test device, click the internal app-sharing link for the version of your app you just uploaded.\n4. Install the app from the Google Play Store page you see after clicking the link."]]