tags:

views:

287

answers:

1

Hi All

I use Instrumentation to test PhoneApp I wrote my test application via Instrumentation

I created apk and installed it on Nexus One - Android Phone - this passed In my code I am using internal classes that are not a part of standard SDK. I build it not in Eclipse but in my embedded env. I am eng in company that developing for Android so I have and Android tree with all internals libraries.

I use appropriate permissions in my manifest .

my apk created probably signed with some signature !! But probably this signature not good enough.

Now I run test via adb and got this error immediately:

-------------------------------------------------------------------------------------
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{com.android.phonetests/com.android.phonetests.PhoneInstrumentationTestRunner} from pid=495, uid=495 not allowed because package com.android.phonetests does not have a
 signature matching the target com.android.phone
INSTRUMENTATION_STATUS_CODE: -1
java.
lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.android.phonetests/com.android.phonetests.PhoneInstrumentationTestRunner} from pid=495, uid=495 not allowed because package com.android.phonetests does not have a
signature matching the target com.android.phone
-------------------------------------------------------------------------------------

Please help.

A: 

I think the problem might be the certificate used to sign your "main" app and your test app is different. I assume your test app is defining itself as an instrumentation of your main app. Doing this allows your test app to run in the main app's process, access its classes, etc, and thus for security reasons the two apps must be signed with the same certificate.

The answer is from this forum.

zed_0xff
You seeWhen I am my app on our platform (Phone device) I don't get such Permission Denial !!This happens only if I installed and run my apk on reference phone for example Nexus One of Google or any other. My app testing phone app that is running on Phone??
ilana