发布专用应用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通过 Google Play Custom App Publishing API 发布的应用永远不能
已公开。它们的验证流程要比
公开应用,将发布时间缩短至只需 5 分钟
(相比之下,使用 Play 管理中心需要 2 个多小时)。
如需为企业发布专用应用,请调用
Accounts.customApps.create
、
将企业的开发者账号 ID 作为参数传递。中
请求正文是应用标题和应用的默认商品详情
语言。请确保您发布的所有专用应用也符合以下要求
要求:
- 软件包名称是 Google Play 独有的(不仅仅是开发者账号独有的名称)。
- 应用名称专属于开发者账号。
示例
Path apkPath = Paths.get("PATH_TO_APK");
ByteArrayContent apk =
new ByteArrayContent("application/octet-stream", Files.readAllBytes(apkPath));
CustomApp appMetadata =
new CustomApp()
.setTitle("APPLICATION TITLE")
.setLanguageCode("en_US")
.setOrganizations(
List.of(
new CustomAppOrganization()
.setOrganizationId("C0123wxyz")
.setOrganizationName("My organization")));
CustomApps.Create request =
apiClient.accounts() // Playcustomapp apiClient
.customApps()
.create(DEV_ACCOUNT_ID, appMetadata, apk);
CustomApp response = request.execute();
System.out.println(response);
如果成功,该应用即会显示在相应开发者账号的已发布列表中
立即在 Play 管理中心内管理应用。该应用将可供分发
并在五分钟内将消息发送给最终用户
默认情况下,发布的专用应用仅供组织使用
与开发者账号相关联。要设置
专用应用,请将组织 ID 添加到
organizations
属性。
分发专用应用
专用应用发布后会自动获得批准,但不会自动获得批准
可供用户使用,除非企业 IT 管理员明确授予他们访问权限
所有获得批准的应用您可以使用以下命令在 EMM 控制台中启用此功能:
Users.setAvailableProductSet
(将 productSetBehavior
设置为 "allApproved"
)。
您也可以使用相同的通话,让 IT 管理员将特定应用列入许可名单
(将 productSetBehavior
设为 "whitelist"
)。
如需详细了解如何向用户的 Google Play 企业版商店添加应用,
请参阅创建自定义商店布局。
更新专用应用
为了尽可能为您的企业客户提供最佳用户体验,
我们建议将专用应用发布与应用商店和
列出了通过 Google Play Publishing API 提供的更新功能。
这样一来,IT 管理员就能够发布、修改和更新专用应用
直接在 EMM 控制台或 IDE 中运行。您可以使用
您为专用应用发布而创建,用于授权 Google Play Publishing API
请求。
您或您的企业客户还可以更新专用应用及其商店
商品详情详细信息(如需了解详情,请参阅 Play 管理中心帮助中心)。
使用客户端库编码入门指南
适用于 Google Play Custom App Publishing API 的客户端库可在以下位置找到:
Java、
Python、
.NET、
和 Ruby。
详细了解 Android Enterprise
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Google Play Custom App Publishing API enables publishing private apps for enterprises, subject to a lighter verification process compared to public apps.\u003c/p\u003e\n"],["\u003cp\u003ePrivate apps are automatically approved upon publishing but require explicit IT admin authorization for user access via an EMM console.\u003c/p\u003e\n"],["\u003cp\u003ePrivate apps can be updated programmatically through the API or manually via the Google Play Console by developers or enterprise customers.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries for the API are available in Java, Python, .NET, and Ruby for streamlined integration into existing workflows.\u003c/p\u003e\n"]]],[],null,["# Publish a private app\n\nApps published through the Google Play Custom App Publishing API can never be\nmade public. They're subject to a lighter weight verification process than\npublic apps as a result, reducing publishing time to as little as five minutes\n(compared to over two hours via the Play Console).\n\nTo publish a private app for an enterprise, call\n[`Accounts.customApps.create`](/android/work/play/custom-app-api/v1/accounts/customApps/create),\npassing the enterprise's developer account ID as a parameter. The only required fields in\nthe request body are the title of the app and the app's default listing\nlanguage. Make sure that any private app you publish also meets the following\nrequirements:\n\n- The package name is unique to Google Play (not just unique to the developer account).\n- The title of the app is unique to the developer account.\n\nExample\n-------\n\n Path apkPath = Paths.get(\"PATH_TO_APK\");\n ByteArrayContent apk =\n new ByteArrayContent(\"application/octet-stream\", Files.readAllBytes(apkPath));\n\n CustomApp appMetadata =\n new CustomApp()\n .setTitle(\"APPLICATION TITLE\")\n .setLanguageCode(\"en_US\")\n .setOrganizations(\n List.of(\n new CustomAppOrganization()\n .setOrganizationId(\"C0123wxyz\")\n .setOrganizationName(\"My organization\")));\n\n CustomApps.Create request =\n apiClient.accounts() // Playcustomapp apiClient\n .customApps()\n .create(DEV_ACCOUNT_ID, appMetadata, apk);\n\n CustomApp response = request.execute();\n System.out.println(response);\n\nIf successful, the app will appear in the developer account's list of published\napps in the Play Console immediately. The app will be available for distribution\nto end users within five minutes.\n\nBy default, the published private app is only available to the organization\nlinked to the developer account. To set the organizations to which the\nprivate app should be made available, add the organization IDs to the\n`organizations` property.\n\n### Distributing private apps\n\n| **Note:** You must be a member of the [Android EMM Developer\n| Community](https://emm.androidenterprise.dev/) to use the Google Play EMM API to enable private app distribution. For more information, see the [EMM developer's\n| overview](/android/work/overview).\n\nPrivate apps are automatically approved when published, but aren't automatically\navailable to a user unless an enterprise IT admin explicitly grants them access\nto all approved apps. You can enable this feature in your EMM Console using\n[Users.setAvailableProductSet](/android/work/play/emm-api/v1/users/setAvailableProductSet)\n(set `productSetBehavior` to `\"allApproved\"`).\n\nYou can also use the same call to enable IT admins to allowlist specific apps\nfor a user (set `productSetBehavior` to `\"whitelist\"`).\nFor more information about how to add apps to a user's managed Google Play store,\nsee [Create custom store layouts](/android/work/play/emm-api/store-layout).\n\nUpdating a private app\n----------------------\n\nTo provide the best possible user experience for your enterprise customers,\nwe recommend integrating private app publishing alongside the app and store\nlisting update features available through the [Google Play Publishing API](https://developers.google.com/android-publisher/).\nDoing so gives IT admins the ability to publish, edit, and update private apps\ndirectly from your EMM console or IDE. You can use the same service account that\nyou created for private app publishing to authorize Google Play Publishing API\nrequests.\n\nYou or your enterprise customer can also update private apps and their store\nlisting details from the Play Console (for more information, see the [Play Console help center](https://support.google.com/googleplay/android-developer/)).\n\nStart coding with our client libraries\n--------------------------------------\n\nClient libraries for the Google Play Custom App Publishing API are available in\n[Java](https://developers.google.com/api-client-library/java/apis/playcustomapp/v1),\n[Python](https://developers.google.com/api-client-library/python/apis/playcustomapp/v1),\n[.NET](https://developers.google.com/api-client-library/dotnet/apis/playcustomapp/v1),\nand [Ruby](https://developers.google.com/api-client-library/ruby/apis/playcustomapp/v1).\n\nLearn more about Android Enterprise\n-----------------------------------\n\n- For more information about developing an EMM solution for Android, see [Android Enterprise](https://developers.google.com/android/work/).\n- For information about best practices for developing Android apps for enterprise distribution, see [Android for\n enterprise](https://developer.android.com/work/)."]]