How to compile Android Application with system permissions

The question:

I need to compile an application with system permissions in order to use target application For now while I try to run my apk I get the error message

Test run failed: Permission Denial:
starting instrumentation
from pid=354, uid=354 not allowed
because package com.jayway.test does
not have a signature matching the

How can I compile my application with system permissions?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

After having some search I found how to sign my application with system (platform) key.
System signatures are located in directory <root-of-android-source-tree>/build/target/product/security. You can use them to sign your application with system privileges.

Method 2

  1. Add to manifest android:sharedUserId=”android.uid.system”

  2. Download System signatures files:


  1. Sign app through terminal (java -jar signapk.jar platform.x509.pem platform.pk8 unsigned.apk signed.apk) (first you must put all files to one folder), or make certificate with keytool-importkeypair to make google_certificate.keystore and then

link for keytool-importkeypair download and explanation:

  1. After that steps install your signed system app to your device. Good luck!!!

Method 3

The anser for me was simply delete the debug.keystore file. The default storage location for AVDs is in ~/.android/ on OS X and Linux, in C:Documents and on Windows XP, and in on Windows Vista.

In Eclipse I “cleaned” the project, uninstalled the App and the TestApp from the emulator and – voila everything ran fine again.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment