顯示具有 AOSP 標籤的文章。 顯示所有文章
顯示具有 AOSP 標籤的文章。 顯示所有文章

2014年12月28日 星期日

[Android][AOSP] Run Application in System Process

The method described here is for AOSP make, not including Eclipse and Android Studio build.

In Android.mk, add

LOCAL_CERTIFICATE := platform

In AndroidManifest, under block, add


android:sharedUserId="android.uid.system"

under </application> block, add

android:process="system"

and get back to the project folder and make (command mm) to build the app

To verify, launch the app and check the logcat for log from the app.

If the "Application" column shows "system_process", and the "PID" is the same as other system process (e.g. WindowManager, ActivityManager), then it's successful.