如何在不从市场购买的情况下测试授权的 android apk?

发布于 2024-10-12 11:47:05 字数 619 浏览 6 评论 0原文

我想将付费应用程序发布到 android 市场,因此我将 android LVL 添加到我的 apk 中。我在手机上测试过。当我安装应用程序时,它显示检查手机状态、市场许可证的权限。安装后尝试运行,提示“未找到许可证,去市场购买”。看来它可以工作,因为 apk 不允许 无需从市场下载即可运行。

现在的问题是,如何测试或模拟买家的情况?这意味着买家在购买我的应用程序后能够运行我的应用程序。如果购买后无法运行并提示未找到许可证,则说明我的许可证检查有问题。我已经将我的 Gmail 包含到 market.android.com 仪表板中的“编辑个人资料”中。我将状态更改为已许可、未许可、旧许可。但没有回复发送到我的 Gmail。所以我不知道该怎么做。

它是否已经在 Google 许可证服务器上完成,或者我需要修改 android market 许可证代码包吗?我检查是否有代码可以处理许可证、无许可证、旧许可证、市场错误等情况的请求。

这是因为android模拟器没有市场,而且我无法在帐户中添加google帐户(仅交换帐户)并在模拟器中同步(在1.6,2.2和2.3中尝试过)。所以我只能在我的真实安卓手机上进行测试。

任何人都有测试付费应用程序的经验或一些方法,而无需从市场购买自己的应用程序,如果有人购买我的应用程序,我如何也测试许可证服务器的响应?

I would like to publish paid application to android market, so I added android LVL into my apk. I have tested on my mobile. When I install apps, it shows the permission to check phone status, market license. After installation, I try to run and prompt "license not found and go to market to purchase". It seems that it works as apk is not allowed
to run without downloading from market.

The problem now, how can I test or emulate the buyer situation ? That means will buyer able to run my apps after they buy my apps. If they cannot run and prompt license not found after purchasing, then my license check has problems. I already include my gmail into "Edit profile" in dashboard of market.android.com. I changed the status to LICENSED, NON-LICENSED, OLD LICENSED. but no response sent to my gmail. So I don't know how to do it.

Does it already done on Google license server or do I need to modify android market license code package? I check that there is code to handle request for the case like license, no license, old license, market error and so on.

It is because there is no market in android emulator, also I cannot add google account(only exchange account) in account and sync in emulator (tried in 1.6,2.2 and 2.3). So I only can test in my real android phone.

Anyone has experience or some methods to test paid apps without buying own apps from market, how can I also test the response from license server as well if anyone buy my apps ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

摘星┃星的人 2024-10-19 11:47:05

已经过去几个月了,但是这个碰撞可能会对那里的人有所帮助 - 刚刚为我的一个朋友回答了这个问题,他声称在这里找不到答案。听起来您没有设置 Google 体验模拟器。使用 Android 目标的 Google API 版本创建一个新的模拟器,您应该能够为目标级别 3 以上执行此操作。有了这个 API,您就可以访问模拟器中的身份验证服务器(如果您没有 Google API,它们可以在 sdk 管理器中的可用软件包下找到,那么我认为是第三方软件包 iirc)。您甚至不需要上传未发布的 apk,除非您测试应用内购买(可能对于开发帐户以外的测试帐户,我在开发下进行所有测试,所以我不完全确定这一点)。

It's been a few months, but this bump might help someone out there - just answered this question for a friend of mine who claimed to not find the answer here. Sounds like you don't have a Google experience emulator setup. Create a new emulator using the Google API version of android targets, you ought to be able to do that for target level 3 on upwards. With this API in place you'll have access to the authentication servers in your emulator (if you don't have the Google APIs, they're available in the sdk manager under available packages then I think third party packages iirc). You don't even need to upload an unpublished apk unless your testing in-app purchasing (possibly for test accounts other than the dev account, I do all my testing under dev so I'm not entirely sure on that note).

海的爱人是光 2024-10-19 11:47:05

您可以通过发布商帐户面板设置测试帐户。 (如果您还没有设置发布者帐户,则需要设置该帐户。)检查开发人员有关详细信息的许可文档,尤其是有关许可管理设置的部分。

You can set up a test account through your publisher account panel. (You will need to set up a publisher's account if you haven't already.) Check the developer documentation on licensing for details, especially the section on administrative settings for licensing.

尴尬癌患者 2024-10-19 11:47:05

尽管文档提供了有关向应用程序添加许可的详细说明,并且可以为基本许可编辑大部分示例代码,但我发现很少有关于使用 Google API 测试许可的内容,就好像它是您的购买者一样应用程序。文档中的“设置许可”详细介绍了“在运行时环境中登录授权帐户”,但这只是您想要做的事情的冰山一角。以下是我使用的步骤:

  1. 使用 Google API 创建 AVD
  2. 创建一个新的虚拟 gmail/google 帐户来测试
  3. 将该帐户添加到 AVD。进入 AVD 中的“设置/帐户/添加”是最简单的方法。使用“开发工具”是有问题的:单击“开发工具/帐户测试器”,单击“公司”一词,这是一个下拉列表窗口,尽管设计并没有使其那么明显,但在新窗口中单击“谷歌”一词出现在应用程序屏幕底部的“公司”一词,而不是“公司”一词的位置,请单击“添加”,这会将您带到与“设置/帐户/添加”相同的窗口。
  4. 将该帐户添加到开发者控制台的“测试帐户”部分,
  5. 将“导出的”.apk 文件安装到 AVD(您上传的文件)。至少据我所知,这必须使用“adb”在命令提示符下完成。
  6. 使用您的虚拟 Google 帐户运行导出的 .apk,并查看它根据您在开发者控制台中设置“测试响应”的方式进行响应,
  7. 测试其他开发者控制台测试响应

。请参阅文档或谷歌搜索以进一步详细说明每个步骤。

altough the docs give long detailed instructions on adding licensing to an app, and much of the sample code can be edited for bare-bones licensing, i've found little on testing that licensing with the Google API as if it were the buyer of your app. the "Setting Up for Licensing" in the docs details "signing into an authorized account in a runtime environment", but that's just the tip of a large iceburg for what you want to do. here are the steps i use:

  1. create an AVD with the Google API
  2. create a new dummy gmail/google account to test with
  3. add that account to the AVD. going to "settings/accounts/add" in the AVD is easiest for this. using the "dev tools" is buggier: click "dev tools/accounts tester", click the word "corporate", which is a dropdown list window although the design doesnt make it that apparent, click the word "google" in the new window that appears at the bottom of the app screen instead of where the word "corporate" was and remains, click "add" which brings you to the same window that just going to "settings/accounts/add" brings you.
  4. add that account to the "test accounts" section of your Developer Console
  5. install the "exported" .apk file to the AVD (the one you uploaded). this has to be done with the command prompt using "adb", at least to my knowledge.
  6. run the exported .apk with your dummy google account and see that it responds according to however you set your "test reponse" in the Developer Console
  7. test the other Developer Console test responses

whew. refer to the docs or a google search for further elaboration on each step.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文