API 自动上传 apk 到 Google Play?

是否有任何 API 或工具,使我能够自动上传一个 APK 到谷歌播放?我想自动发布定制的应用程序到我的帐户没有任何手动步骤或图形界面。

我到处搜索了一下,但是没有找到任何用于这样做的 API (只有 机器人出版商,但是它不支持发布,尽管它的名字是这样的)。有人已经解决这个问题了吗,看起来像是一个基本功能?

44767 次浏览

There is no official Google API for automating working with Google Play. (This is NOT true after July 2014)

You can create a script that encapsulates a web browser and simulates user bevahiour: find HTML fields, enter info there, submitting the page, etc.

We are working on such open-source Python tool: https://github.com/onepf/AppDF/tree/master/tools/uploader

As of today there is a new official publishing API That allows you to upload to any channel (ie. alpha, beta...) or update title and description and more.

From the docs:

  • Uploading new versions of an app Releasing apps, by assigning APKs to various Tracks (alpha, beta, staged rollout, or production)
  • Creating and modifying Google Play Store listings, including
  • localized text and graphics and multi-device screenshots

Look here for more info: https://developers.google.com/android-publisher/

I answered this also on this question, but I figured I'd add the same comment here. Let me know if that's the wrong way to do this (duplicating answers).

I was able to create a gradle plugin that does the publishing to any track you wish for any flavor/variant you wish using the new Google Play Publishing APIs.

See the sources here: https://github.com/bluesliverx/savillians-gradle

I'm working on publishing this to maven central so it can be used in a build script, but for now you can grab the android-publisher subdirectory in the repo, put it in the root of your gradle build, and rename the folder to buildSrc. Use the following line in the build.gradle file for the android project you want to publish:

apply plugin: com.savillians.gradle.androidpublisher.AndroidPublisherPlugin

You can then set your publishing settings using an androidPublisher block in the build.gradle file.

android {
...
}
androidPublisher {
applicationName = "Company-Name-Product-Name/1.0"
packageName = "<package name>"
serviceAccountEmail = "<service account email>"
serviceAccountKeyFile = file('<p12 keyfile - NOT the json file>')
track = "alpha" // default, don't need to specify
variantName = "release" // default, don't need to specify
}

Make sure the service account you create has "release manager" permissions, download the p12 key file and put it in the project's directory. Then run this command:

gradle androidPublish

That will send it to Google Play using the credentials you specified. Good luck and let me know if you have questions since this is brand new.

gradle-play-publisher is a Gradle plugin to upload your APK and app details to the Google Play Store.

I simply run ./gradlew publishApkRelease from my terminal and it uploads the APK and the summary of recent changes., there are more task like this available.

It uses the The Google Play Developer API