将.apk安装到android模拟器时出错

时间:2012-03-09 15:24:22

标签: android android-emulator

我正在尝试将我的.apk文件安装到模拟器,但它给了我错误。

subh@subh:~/subh/droidbox/android-sdk-linux/platform-tools$ ./adb -s emulator-5554 install /home/subh/subh/androidapp/HelloAndroid/bin/HelloAndroid-release-unsigned.apk 
11 KB/s (2919 bytes in 0.245s)
pkg: /data/local/tmp/HelloAndroid-release-unsigned.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

然后我用jarsigner签署.apk

subh@subh:~/subh/androidapp/HelloAndroid/bin$ jarsigner -verify -verbose -certs HelloAndroid-release-unsigned.apk

  s = signature was verified 
  m = entry is listed in manifest
  k = at least one certificate was found in keystore
  i = at least one certificate was found in identity scope

no manifest.
jar is unsigned. (signatures missing or not parsable)
subh@subh:~/subh/androidapp/HelloAndroid/bin$ 

但我仍然有证书问题。

2 个答案:

答案 0 :(得分:0)

第二个命令似乎给出了错误。您可以尝试在Eclipse中清理项目并创建新的APK吗?

答案 1 :(得分:0)

我得到了答案。在我们想要发布它之前需要签名。 在ant的情况下,我们有两种调试和释放模式。

# ant debug

这将自动生成密钥对并为我们签署.apk以进行调试。

#ant release

这将需要在build.xml中指定密钥库。 了解更多详情http://developer.android.com/guide/developing/building/building-cmdline.html    http://developer.android.com/guide/publishing/app-signing.html