男人应似海  

Android关闭JIT的方法

 

关于JIT的介绍请参考http://www.cnblogs.com/leaven/archive/2010/05/26/1744019.html

 

Android 2.2的新特性中有条是“使用了全新的JIT内核编译器”,号称性能提高了5倍。有得同学提出JIT会带来稳定性问题,有时会报异常。下面是关闭系统JIT的方法:

在AndroidManifest.xml中把<application>的android:vmSafeMode属性设置true就可以对APK禁用JIT。

示例:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="test.ts.wader.mytest"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" 
        android:vmSafeMode="true">
        <activity
            android:label="@string/app_name"
            android:name=".MyTestActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

posted on 2011-11-25 10:35  男人应似海  阅读(5476)  评论(0编辑  收藏  举报