简体   繁体   English

有没有办法在eclipse上添加我的签名,以便我可以从Eclipse运行我的代码?

[英]Is there any way to add my signature on the eclipse, so that i can run my code from Eclipse?

I am newbie to Robotium. 我是Robotium的新手。 Everytime, if i change code, i need to create apk and then i need to install in emulator and have to proceed the testing by running shell command. 每次,如果我改变代码,我需要创建apk然后我需要在模拟器中安装,并且必须通过运行shell命令继续测试。

Is there any way to add my signature on the eclipse, so that i can run from Eclipse? 有没有办法在eclipse上添加我的签名,以便我可以从Eclipse运行?

I have tried the preferences and it has customer keystore but i did not get any field to enter the password. 我已经尝试了首选项,它有客户密钥库,但我没有得到任何字段输入密码。

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks 谢谢

It is very easier than this. 它比这更容易。 If eclipse and Android SDK are properly configured, you can run your app on real device or emulator by just a single click. 如果正确配置了eclipseAndroid SDK ,只需单击一下即可在真实设备或模拟器上运行您的应用程序。 In such cases, eclipse would use a debug key to sign apps. 在这种情况下,eclipse将使用debug key来签署应用程序。

when you want to release final apk , you should right-click on project and from Android tools , select Export signed Application... and then make your keystore or use a previous one to sign release package. 当你想要发布最终apk时 ,你应该右键单击项目,然后从Android tools中选择Export signed Application...然后创建你的密钥库或使用前一个密钥库来签署发布包。

if you are using different apk which your are not created and see " signature mismatch ", then you need to change Signature of that apk, 如果你使用不同的apk,你没有创建并看到“签名不匹配”,那么你需要更改该apk的签名,

1)- Delete " META-INF " folder from TestApp.apk 1) - 从TestApp.apk中删除“ META-INF ”文件夹

2)- jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore debug.keystore -storepass android -keypass android TestApp.apk androiddebugkey 2) - jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore debug.keystore -storepass android -keypass android TestApp.apk androiddebugkey

and you find " debug.keystore " from C:\\Users\\YourUserName\\\\.android\\ if you have installed eclipse and Android SDK properly. 如果你已经正确安装了eclipse和Android SDK,你可以从C:\\Users\\YourUserName\\\\.android\\找到“ debug.keystore ”。

3)- zipalign 4 TestApp.apk SignedTestApp.apk 3) - zipalign 4 TestApp.apk SignedTestApp.apk

4)- jarsigner -verify SignedTestApp.apk 4) - jarsigner -verify SignedTestApp.apk

5)- install SignedTestApp.apk , and test your automation again. 5) - 安装SignedTestApp.apk ,并再次测试您的自动化。

for example, you want to do automation for gmail app then TestApp.apk = Gmail.apk 例如,您想为gmail应用程序执行自动化,然后TestApp.apk = Gmail.apk

you can find for info from this link . 你可以从这个链接找到信息。 I hope this will solve your issue of " signature mismatch ". 我希望这能解决你的“ signature mismatch ”问题。

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

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