《苏菲的世界》经典语:你是谁?世界从哪里来?同样适用于我们每个人,软件测试路在何方,路在脚下!!!
Android自动化robotium之(二)APK签名冲突问题
上一篇 /
下一篇 2014-05-30 17:46:09
/ 个人分类:自动化测试
今天在使用Robotium进行Android自动化测试的时候遇到一个问题:Test run failed: Permission
Denial: starting instrumentation
ComponentInfo{com.local.test/android.test.InstrumentationTestRunner} from
pid=356, uid=356 not allowed because package com.local.test does not have a
signature matching the target com.***
提示是说签名不匹配,由于没有源码,无法生成签名。
I have solved the problem.Because two
debug.keystore files in my PC.
One is C:\Users\admin\.android\debug.keystore.
The other one is
D:\android\avd\.android\debug.keystore.
The information about keystore in eclipse
(Window->preference->Android->build)is
D:\android\avd\.android\debug.keystore.
So my apk is signed by
D:\android\avd\.android\debug.keystore But the Application Under Test is signed
by C:\Users\admin\.android\debug.keystore.
So change the keystore in eclipse
(Window->preference->Android->build) to be
C:\Users\admin\.android\debug.keystore.
你的测试APK会用你eclipse里面默认的也就是D盘下面的keystore去签
那个resign.jar包是用的你c盘下面的keystore去签。。两者不一样。所以要把eclipse里默认keystore改成C:\Users\admin\.android\debug.keystore.具体请参考http://hi.baidu.com/rzrpznspzdbciqq/item/af51ed9cb31b0fbacc80e5f7
纠结了两天终于找到方法解决了:
原因:Built路径在搞鬼(即default debug keystore的路径)该路径要和android的AVD默认路径一至,且路径中不能有中文,
解决方法:default debug keystore这个路径不能直接改。得用以下方法改动
打开系统属性-->环境变量—>在“系统变量”那一个GroupBox下面选择“新建”-->变量名为"ANDROID_SDK_HOME” (注意,这个变量名不能改变,只能是这个名字!),然后把变量值改为你想把AVD所在的".android”文件夹放置的位置,比如我就放在E:\android\android-sdk-windows,也可以更改成其它的路径
设定成功的话 ,在eclipse里preferneces
-> Android -> Bulid Setting里为如下结果:Default debug
keystore: E:\android\android-sdk-windows\.android\debug.keystore
收藏
举报
TAG:
冲突