简体   繁体   English

由于错误,无法在cmd上签署apk文件

[英]Cannot Sign apk file on cmd due to errors

I am trying to sign an .apk file created by Phonegap in a Windows 7 system. 我正在尝试在Windows 7系统中签署Phonegap创建的.apk文件。

Here is what I'm running: 这是我正在运行的:

jarsigner -verbose -keystore C:\\Users\\myuser\\Desktop\\myCertificate.keystore C:\\folder\\myapp.apk myKey jarsigner -verbose -keystore C:\\ Users \\ myuser \\ Desktop \\ myCertificate.keystore C:\\ folder \\ myapp.apk myKey

Then I'm asked for the password and I enter it correctly. 然后我被要求输入密码,我输入正确。 Lastly I get: 最后我得到:

jarsigner: unable to open jar file: C:\\myapp.apk jarsigner:无法打开jar文件:C:\\ myapp.apk

I'm following the instructions from here 我按照这里的说明进行操作

也许apk不在您提供的路径上

Try these instructions, and make sure you put filenames in quotes if they have spaces. 请尝试这些说明,并确保如果文件名有空格,则将其放在引号中。

http://developer.android.com/tools/publishing/app-signing.html#releasemode http://developer.android.com/tools/publishing/app-signing.html#releasemode

I was not able to get jarsigner to sign my APK using Android's documentation or any workarounds posted in similar threads. 我无法让jarsigner使用Android的文档或在类似线程中发布的任何变通办法来签署我的APK。 Instead, I was able to sign my app using the ant release command using the instructions found here: How to Sign and Publish a Phonegap App in the Google Play Store . 相反,我能够使用ant release命令使用以下说明签署我的应用程序: 如何在Google Play商店中签名和发布Phonegap应用程序

In short: 简而言之:

1) Create a ant.properties file in platforms/android with your keystore information like this: 1)使用您的密钥库信息在platforms/android创建一个ant.properties文件:

key.store=/Users/username/Documents/path/to/my-release-key.keystore key.alias=app_name

2) Run these commands 2)运行这些命令

phonegap build android cd platforms/android ant release

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM