How do I install an apk as a system application? I'm trying to install an application in the system/app folder of a device. It needs to be done since I'm writing a QAT program and the tests need to run with a few privileges not available to third party apps. 

I already have the device's firmware signing key and need to set the sharedUserId of the application to android.uid.system . It however keeps giving me a failure message "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE" .

Any ideas on how I can fix this?
Found these instructions to install PowerManagerPro into /system/app, just modified them a little.
(Note: first install the app into /data/app, like you would any app, and you need a rooted device.)


  Open a Terminal Emulator app and execute the following command to copy the application to the sdcard:


su
cp /data/app/your.apk /sdcard/your.apk

  
  If you can't find the application in /data/app try /data/apps-private/.
  Then, un-install your app from the device.
  
  Execute the following commands in the terminal emulator to remount the /system directory as read/write and to install the application into the /system/app directory:


su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cp /sdcard/your.apk /system/app

  
  If you prefer to use adb from your computer, execute these commands:


adb remount
adb shell cp /sdcard/your.apk /system/app