RK平台第一次开机速度优化 "Large app, accepted running with swap."
- 问题描述
- 解决方法
郑重声明:本人原创博文,都是实战,均经过实际项目验证出货的
转载请标明出处:攻城狮2015
Platform: Rockchip
OS:Android 6.0.1
CPU:3368
Kernel: 3.10
问题描述
最近遇到个问题,系统刷完机后,第一次开机,时间超级久,久到离谱,需要8分钟多,才能开机。生产那边先太浪费时间。先需要优化开机时间。
解决方法
1.优化开机时间,有很多种方法,但是优化第一次开机时间,先得知道第一次开机,是解包各种服务apk,加载出资源文件。
2.查找第一次开机时间久的根本原因是什么导致的。
3.怎么进行第一次开机时间优化。
1.经过排查发现,以前的固件开机时间是4-5分钟,经过排查发现,时间变长是加了gms
2.同时查看logcat信息进一步论证这个gms导致
logcat信息
01-21 17:55:58.134 I/dex2oat ( 1902): Starting dex2oat.
01-21 17:56:00.816 I/dex2oat ( 1902): Large app, accepted running with swap.
01-21 17:56:21.144 W/dex2oat ( 1902): Verification of void bpk.a(byte[], byte[]) took 134.308ms
01-21 17:56:21.158 W/dex2oat ( 1902): Verification of void bpl.a(byte[], byte[]) took 146.379ms
01-21 17:56:21.194 W/dex2oat ( 1902): Verification of void bpp.a(byte[], byte[]) took 159.406ms
01-21 17:56:21.199 W/dex2oat ( 1902): Verification of void bpq.a(byte[], byte[]) took 151.839ms
01-21 17:56:21.232 W/dex2oat ( 1902): Verification of void bpr.a(byte[], byte[]) took 145.564ms
01-21 17:56:21.292 W/dex2oat ( 1902): Verification of void bps.a(byte[], byte[]) took 180.747ms
01-21 17:56:21.342 W/dex2oat ( 1902): Verification of void bpt.a(byte[], byte[]) took 138.764ms
01-21 17:56:21.342 W/dex2oat ( 1902): Verification of void bpu.a(byte[], byte[]) took 133.535ms
01-21 17:56:21.470 W/dex2oat ( 1902): Verification of void bpv.a(byte[], byte[]) took 149.697ms
01-21 17:56:23.915 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.e.a(byte[], byte[]) took 119.681ms
01-21 17:56:23.926 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.k.a(byte[], byte[]) took 104.842ms
01-21 17:56:23.943 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.g.a(byte[], byte[]) took 145.134ms
01-21 17:56:23.944 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.j.a(byte[], byte[]) took 141.547ms
01-21 17:56:24.024 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.l.a(byte[], byte[]) took 139.246ms
01-21 17:56:24.144 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.p.a(byte[], byte[]) took 147.684ms
01-21 17:56:24.154 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.o.a(byte[], byte[]) took 158.976ms
01-21 17:56:24.202 W/dex2oat ( 1902): Verification of void com.google.android.gms.ads.settings.util.q.a(byte[], byte[]) took 176.876ms
01-21 17:56:31.786 W/dex2oat ( 1902): Verification of void jik.<clinit>() took 213.807ms
01-21 17:56:48.975 W/dex2oat ( 1902): Compilation of void aiqz.a(long, aipc) took 114.497ms
01-21 17:56:49.131 W/dex2oat ( 1902): Compilation of void aiud.a(double[]) took 112.384ms
01-21 17:56:49.978 W/dex2oat ( 1902): No verified method for method calling String.<init>: java.lang.String java.io.ByteArrayOutputStream.toString()
01-21 17:56:50.158 W/dex2oat ( 1902): Compilation of void ajrv.a_(java.util.List) took 104.426ms
01-21 17:56:50.689 W/dex2oat ( 1902): Compilation of ajmv akbn.a(ajnu, ajmf, ajml, ajmz, boolean) took 162.618ms
01-21 17:56:50.773 W/dex2oat ( 1902): Compilation of void akcl.a(akho, ajnu[], boolean) took 186.966ms
01-21 17:56:50.801 W/dex2oat ( 1902): Compilation of void akex.handleMessage(android.os.Message) took 117.777ms
01-21 17:56:51.652 W/dex2oat ( 1902): Compilation of int akvs.a(java.lang.String) took 111.694ms
01-21 17:56:52.552 W/dex2oat ( 1902): No verified method for method calling String.<init>: java.lang.String java.io.ByteArrayOutputStream.toString()
01-21 17:56:54.265 W/dex2oat ( 1902): Compilation of void android.support.v7.widget.LinearLayoutCompat.b(int, int) took 113.909ms
01-21 17:56:54.953 W/dex2oat ( 1902): Compilation of int anhz.computeSerializedSize() took 180.823ms
01-21 17:56:55.245 W/dex2oat ( 1902): Compilation of atdk anhz.mergeFrom(atcu) took 291.950ms
01-21 17:56:55.423 W/dex2oat ( 1902): Compilation of void anhz.writeTo(atcv) took 177.030ms
[ 299.700588] [2: healthd: 179] healthd: battery l=66 v=3800 t=22.0 h=2 st=2 c=1000 chg=a 2013-01-21 08:56:56.133308810 UTC
01-21 17:56:56.761 W/dex2oat ( 1902): Compilation of atdk aofg.mergeFrom(atcu) took 107.456ms
01-21 17:56:56.885 W/dex2oat ( 1902): Compilation of atdk aogl.mergeFrom(atcu) took 101.662ms
01-21 17:56:58.878 W/dex2oat ( 1902): Compilation of atdk appj.mergeFrom(atcu) took 102.356ms
01-21 17:56:59.234 W/dex2oat ( 1902): Compilation of atdk aptd.mergeFrom(atcu) took 125.422ms
01-21 17:57:03.268 W/dex2oat ( 1902): Compilation of ancp ancp.a(atcu) took 9.596s
01-21 17:57:07.881 W/dex2oat ( 1902): Compilation of ancs ancs.a(atcu) took 14.205s
01-21 17:57:10.397 W/dex2oat ( 1902): Compilation of void arr.a() took 216.821ms
01-21 17:57:10.412 W/dex2oat ( 1902): Compilation of void aru.a() took 137.632ms
01-21 17:57:11.313 W/dex2oat ( 1902): Compilation of arw asn.a(asg) took 148.613ms
01-21 17:57:11.411 W/dex2oat ( 1902): Compilation of arw aso.a(asg) took 166.075ms
01-21 17:57:11.926 W/dex2oat ( 1902): Compilation of atdk asws.mergeFrom(atcu) took 132.919ms
01-21 17:57:12.421 W/dex2oat ( 1902): Compilation of java.lang.Object atfi.a(int, java.lang.Object, java.lang.Object) took 167.286ms
01-21 17:57:12.572 W/dex2oat ( 1902): Compilation of java.lang.Object atgq.a(int, java.lang.Object, java.lang.Object) took 216.826ms
01-21 17:57:14.697 W/dex2oat ( 1902): Compilation of atdk auqp.mergeFrom(atcu) took 170.475ms
01-21 17:57:14.983 W/dex2oat ( 1902): Compilation of atdk autn.mergeFrom(atcu) took 118.378ms
01-21 17:57:15.049 W/dex2oat ( 1902): Compilation of atdk aura.mergeFrom(atcu) took 483.842ms
01-21 17:57:16.872 W/dex2oat ( 1902): Compilation of byte[] bgr.a(bhc, bha, bdj) took 128.038ms
01-21 17:57:16.910 W/dex2oat ( 1902): Compilation of bbv bgo.a(bdy, bbu) took 160.020ms
01-21 17:57:19.803 W/dex2oat ( 1902): No verified method for method calling String.<init>: void org.json.JSONStringer.<init>(int)
01-21 17:57:20.353 W/dex2oat ( 1902): Compilation of org.json.JSONObject com.google.android.gms.ads.internal.request.service.k.a(com.google.android.gms.ads.internal.request.service.a) took 124.652ms
01-21 17:57:24.527 W/dex2oat ( 1902): Compilation of void com.google.android.gms.smart_profile.SmartProfileChimeraActivity.a(aakr) took 146.931ms
01-21 17:57:24.915 W/dex2oat ( 1902): Compilation of void com.google.android.gms.tapandpay.transaction.WalletTransactionDetailsChimeraActivity.e() took 175.284ms
01-21 17:57:25.774 W/dex2oat ( 1902): Compilation of int com.google.android.libraries.matchstick.net.MessagingService.onStartCommand(android.content.Intent, int, int) took 124.288ms
01-21 17:57:25.870 W/dex2oat ( 1902): Compilation of void com.google.android.libraries.matchstick.ui.MessageActivity.onCreate(android.os.Bundle) took 113.904ms
01-21 17:57:25.940 W/dex2oat ( 1902): Compilation of void com.google.android.libraries.matchstick.net.SilentRegisterIntentOperation.onHandleIntent(android.content.Intent) took 210.698ms
01-21 17:57:26.698 W/dex2oat ( 1902): Compilation of boolean koa.onTransact(int, android.os.Parcel, android.os.Parcel, int) took 105.669ms
01-21 17:57:28.900 W/dex2oat ( 1902): Compilation of erz ets.b(int, int) took 144.930ms
01-21 17:57:32.389 W/dex2oat ( 1902): Compilation of void hyt.a(aluz) took 154.715ms
01-21 17:57:35.984 W/dex2oat ( 1902): Compilation of boolean mri.onTransact(int, android.os.Parcel, android.os.Parcel, int) took 121.063ms
01-21 17:57:36.013 W/dex2oat ( 1902): Compilation of boolean nnu.onTransact(int, android.os.Parcel, android.os.Parcel, int) took 113.086ms
01-21 17:57:37.122 W/dex2oat ( 1902): Compilation of java.lang.Object muw.createFromParcel(android.os.Parcel) took 158.485ms
01-21 17:57:40.331 W/dex2oat ( 1902): Compilation of qfq qfq.a(ozu, aumq) took 146.844ms
01-21 17:57:40.654 W/dex2oat ( 1902): Compilation of void qkx.a(agab) took 101.214ms
01-21 17:57:40.673 W/dex2oat ( 1902): Compilation of boolean qnc.a(java.util.List, long, java.util.HashMap) took 142.439ms
01-21 17:57:41.997 W/dex2oat ( 1902): No verified method for method calling String.<init>: java.lang.String java.io.ByteArrayOutputStream.toString()
01-21 17:57:44.549 W/dex2oat ( 1902): Compilation of boolean trp.onTransact(int, android.os.Parcel, android.os.Parcel, int) took 142.427ms
01-21 17:57:44.954 W/dex2oat ( 1902): Compilation of uir[] udx.a(java.lang.String, uis[], uix[]) took 106.617ms
01-21 17:57:45.244 W/dex2oat ( 1902): Compilation of boolean ufv.a(java.lang.String, long) took 198.961ms
01-21 17:57:46.615 W/dex2oat ( 1902): Compilation of void vsf.d(kwd) took 106.149ms
01-21 17:57:46.949 W/dex2oat ( 1902): Compilation of vxw vvy.a(com.google.android.gms.plus.service.v2whitelisted.models.Person, vxw) took 310.881ms
01-21 17:57:46.987 W/dex2oat ( 1902): Compilation of boolean wba.onTransact(int, android.os.Parcel, android.os.Parcel, int) took 107.139ms
01-21 17:57:47.384 W/dex2oat ( 1902): Compilation of com.google.android.gms.common.data.DataHolder wmg.a(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.util.List, int, boolean, long, java.lang.String, int, int, int, boolean) took 112.329ms
01-21 17:57:49.215 W/dex2oat ( 1902): Compilation of java.lang.Object yai.createFromParcel(android.os.Parcel) took 144.272ms
01-21 17:57:50.273 W/dex2oat ( 1902): Compilation of java.lang.Object ywz.createFromParcel(android.os.Parcel) took 143.959ms
01-21 17:57:50.986 W/dex2oat ( 1902): Compilation of boolean zmq.a(long, int, byte[], int) took 134.921ms
[ 358.744760] [0: healthd: 179] healthd: battery l=66 v=3800 t=22.0 h=2 st=2 c=1000 chg=a 2013-01-21 08:57:56.137474922 UTC
01-21 17:57:57.463 I/dex2oat ( 1902): dex2oat took 119.262s (threads: 8) arena alloc=180MB java alloc=44MB native alloc=259MB free=1221KB swap=80MB
01-21 17:57:57.659 I/PackageManager.DexOptimizer( 621): Running dexopt (dex2oat) on: /system/priv-app/GmsCore/GmsCore.apk pkg=com.google.android.gms isa=arm64 vmSafeMode=false debuggable=false oatDir = null bootComplete=false
01-21 17:57:57.744 I/dex2oat ( 1934): Starting dex2oat.
01-21 17:58:00.373 I/dex2oat ( 1934): Large app, accepted running with swap.
01-21 17:58:20.700 W/dex2oat ( 1934): Verification of void bpm.a(byte[], byte[]) took 101.411ms
01-21 17:58:20.721 W/dex2oat ( 1934): Verification of void bpk.a(byte[], byte[]) took 128.921ms
01-21 17:58:20.723 W/dex2oat ( 1934): Verification of void bpl.a(byte[], byte[]) took 128.119ms
01-21 17:58:20.739 W/dex2oat ( 1934): Verification of void bpq.a(byte[], byte[]) took 116.672ms
01-21 17:58:20.748 W/dex2oat ( 1934): Verification of void bpp.a(byte[], byte[]) took 129.126ms
01-21 17:58:20.839 W/dex2oat ( 1934): Verification of void bpr.a(byte[], byte[]) took 170.591ms
01-21 17:58:20.903 W/dex2oat ( 1934): Verification of void bps.a(byte[], byte[]) took 206.649ms
01-21 17:58:20.924 W/dex2oat ( 1934): Verification of void bpt.a(byte[], byte[]) took 125.802ms
01-21 17:58:20.928 W/dex2oat ( 1934): Verification of void bpu.a(byte[], byte[]) took 121.690ms
01-21 17:58:21.036 W/dex2oat ( 1934): Verification of void bpv.a(byte[], byte[]) took 148.830ms
01-21 17:58:23.016 W/dex2oat ( 1934): Verification of void com.google.android.gms.ads.settings.util.f.a(byte[], byte[]) took 106.027ms
01-21 17:58:23.020 W/dex2oat ( 1934): Verification of void com.google.android.gms.ads.settings.util.h.a(byte[], byte[]) took 108.827ms
01-21 17:58:23.024 W/dex2oat ( 1934): Verification of void com.google.android.gms.ads.settings.util.j.a(byte[], byte[]) took 109.112ms
01-21 17:58:23.026 W/dex2oat ( 1934): Verification of void com.google.android.gms.ads.settings.util.e.a(byte[], byte[]) took 115.909ms
01-21 17:58:23.162 W/dex2oat ( 1934): Verification of void com.google.android.gms.ads.settings.util.o.a(byte[], byte[]) took 107.766ms
01-21 17:58:23.179 W/dex2oat ( 1934): Verification of void com.google.android.gms.ads.settings.util.n.a(byte[], byte[]) took 130.419ms
01-21 17:58:27.413 W/dex2oat ( 1934): Verification of void jik.<clinit>() took 141.130ms
01-21 17:58:34.411 W/dex2oat ( 1934): Compilation of void absi.<init>(android.content.Context, java.lang.String, acat, acaz, abqg, abpx) took 170.564ms
01-21 17:58:36.973 W/dex2oat ( 1934): Compilation of java.lang.Integer aebr.b() took 165.151ms
01-21 17:58:38.438 W/dex2oat ( 1934): Compilation of int afft.a(java.lang.String, affu) took 106.839ms
01-21 17:58:42.761 W/dex2oat ( 1934): Compilation of void aiqz.a(long, aipc) took 107.033ms
01-21 17:58:42.951 W/dex2oat ( 1934): Compilation of void aiud.a(double[]) took 117.159ms
01-21 17:58:44.146 W/dex2oat ( 1934): No verified method for method calling String.<init>: java.lang.String java.io.ByteArrayOutputStream.toString()
01-21 17:58:45.017 W/dex2oat ( 1934): Compilation of ajmv akbn.a(ajnu, ajmf, ajml, ajmz, boolean) took 195.911ms
01-21 17:58:45.061 W/dex2oat ( 1934): Compilation of void akcl.a(akho, ajnu[], boolean) took 180.897ms
01-21 17:58:45.216 W/dex2oat ( 1934): Compilation of void akex.handleMessage(android.os.Message) took 148.265ms
01-21 17:58:45.911 W/dex2oat ( 1934): Compilation of void akpj.a(android.content.Intent, akno, boolean) took 100.537ms
01-21 17:58:46.056 W/dex2oat ( 1934): Compilation of void akpj.a(android.content.Intent) took 109.699ms
01-21 17:58:46.323 W/dex2oat ( 1934): Compilation of int akvs.a(java.lang.String) took 152.869ms
01-21 17:58:47.465 W/dex2oat ( 1934): No verified method for method calling String.<init>: java.lang.String java.io.ByteArrayOutputStream.toString()
01-21 17:58:47.665 W/dex2oat ( 1934): Compilation of java.lang.String alyl.b(arnx, java.lang.String, char[], char[], java.lang.String) took 128.561ms
01-21 17:58:49.898 W/dex2oat ( 1934): Compilation of void android.support.v7.widget.LinearLayoutCompat.b(int, int) took 181.323ms
01-21 17:58:50.212 W/dex2oat ( 1934): Compilation of void android.support.v7.widget.Toolbar.onLayout(boolean, int, int, int, int) took 110.205ms
01-21 17:58:50.945 W/dex2oat ( 1934): Compilation of int anhz.computeSerializedSize() took 247.999ms
01-21 17:58:50.947 W/dex2oat ( 1934): Compilation of atdk anij.mergeFrom(atcu) took 119.072ms
01-21 17:58:50.994 W/dex2oat ( 1934): Compilation of atdk anic.mergeFrom(atcu) took 230.311ms
01-21 17:58:51.286 W/dex2oat ( 1934): Compilation of atdk anhz.mergeFrom(atcu) took 341.142ms
01-21 17:58:51.498 W/dex2oat ( 1934): Compilation of void anhz.writeTo(atcv) took 210.761ms
01-21 17:58:53.131 W/dex2oat ( 1934): Compilation of atdk aocz.mergeFrom(atcu) took 121.239ms
01-21 17:58:53.555 W/dex2oat ( 1934): Compilation of atdk aogl.mergeFrom(atcu) took 144.003ms
[ 417.780968] [0: healthd: 179] healthd: battery l=66 v=3800 t=22.0 h=2 st=2 c=1000 chg=a 2013-01-21 08:58:56.133689534 UTC
01-21 17:58:57.055 W/dex2oat ( 1934): Compilation of atdk aptd.mergeFrom(atcu) took 144.996ms
01-21 17:58:59.750 W/dex2oat ( 1934): Compilation of ancp ancp.a(atcu) took 10.838s
01-21 17:59:04.337 W/dex2oat ( 1934): Compilation of ancs ancs.a(atcu) took 15.411s
01-21 17:59:06.932 W/dex2oat ( 1934): Compilation of void arr.a() took 108.086ms
01-21 17:59:08.211 W/dex2oat ( 1934): Compilation of arw asn.a(asg) took 217.214ms
01-21 17:59:08.221 W/dex2oat ( 1934): Compilation of arw aso.a(asg) took 149.905ms
01-21 17:59:08.393 W/dex2oat ( 1934): Compilation of atdk asrg.mergeFrom(atcu) took 112.652ms
01-21 17:59:09.566 W/dex2oat ( 1934): Compilation of java.lang.Object atgq.a(int, java.lang.Object, java.lang.Object) took 215.763ms
01-21 17:59:11.893 W/dex2oat ( 1934): Compilation of atdk auqp.mergeFrom(atcu) took 162.988ms
01-21 17:59:12.466 W/dex2oat ( 1934): Compilation of atdk aura.mergeFrom(atcu) took 739.597ms
01-21 17:59:14.286 W/dex2oat ( 1934): Compilation of bbv bgo.a(bdy, bbu) took 100.652ms
01-21 17:59:14.322 W/dex2oat ( 1934): Compilation of bbk bgp.a(bhl, bbi) took 132.441ms
01-21 17:59:14.393 W/dex2oat ( 1934): Compilation of byte[] bgr.a(bhc, bha, bdj) took 181.423ms
01-21 17:59:16.431 W/dex2oat ( 1934): Compilation of void com.google.android.chimera.container.ConfigurationManager.checkConfiguration(android.content.Context, java.util.List, java.util.List, java.util.List, java.lang.String, boolean) took 115.588ms
01-21 17:59:17.578 W/dex2oat ( 1934): No verified method for method calling String.<init>: void org.json.JSONStringer.<init>(int)
01-21 17:59:18.086 W/dex2oat ( 1934): Compilation of java.lang.Object com.google.android.gms.ads.internal.request.s.createFromParcel(android.os.Parcel) took 107.397ms
01-21 17:59:18.217 W/dex2oat ( 1934): Compilation of org.json.JSONObject com.google.android.gms.ads.internal.request.service.k.a(com.google.android.gms.ads.internal.request.service.a) took 165.495ms
01-21 17:59:22.818 W/dex2oat ( 1934): Compilation of void com.google.android.gms.smart_profile.SmartProfileChimeraActivity.a(aakr) took 114.144ms
01-21 17:59:23.229 W/dex2oat ( 1934): Compilation of void com.google.android.gms.tapandpay.transaction.WalletTransactionDetailsChimeraActivity.e() took 139.000ms
01-21 17:59:24.221 W/dex2oat ( 1934): Compilation of int com.google.android.libraries.matchstick.net.MessagingService.onStartCommand(android.content.Intent, int, int) took 100.004ms
01-21 17:59:24.390 W/dex2oat ( 1934): Compilation of void com.google.android.libraries.matchstick.net.SilentRegisterIntentOperation.onHandleIntent(android.content.Intent) took 166.432ms
01-21 17:59:27.742 W/dex2oat ( 1934): Compilation of erz ets.b(int, int) took 181.343ms
01-21 17:59:31.601 W/dex2oat ( 1934): Compilation of void hyt.a(aluz) took 163.388ms
01-21 17:59:32.042 W/dex2oat ( 1934): Compilation of void ihb.a(android.content.Context) took 104.311ms
01-21 17:59:36.862 W/dex2oat ( 1934): Compilation of java.lang.Object muw.createFromParcel(android.os.Parcel) took 156.758ms
01-21 17:59:38.533 W/dex2oat ( 1934): Compilation of java.lang.Object ols.createFromParcel(android.os.Parcel) took 132.922ms
01-21 17:59:40.484 W/dex2oat ( 1934): Compilation of qfq qfq.a(ozu, aumq) took 172.336ms
01-21 17:59:40.823 W/dex2oat ( 1934): Compilation of void qkx.a(agab) took 121.655ms
01-21 17:59:40.838 W/dex2oat ( 1934): Compilation of boolean qnc.a(java.util.List, long, java.util.HashMap) took 125.827ms
01-21 17:59:42.287 W/dex2oat ( 1934): No verified method for method calling String.<init>: java.lang.String java.io.ByteArrayOutputStream.toString()
01-21 17:59:45.102 W/dex2oat ( 1934): Compilation of boolean trp.onTransact(int, android.os.Parcel, android.os.Parcel, int) took 135.513ms
01-21 17:59:45.889 W/dex2oat ( 1934): Compilation of boolean ufv.a(java.lang.String, long) took 189.110ms
01-21 17:59:47.492 W/dex2oat ( 1934): Compilation of void vsf.d(kwd) took 144.741ms
01-21 17:59:47.709 W/dex2oat ( 1934): Compilation of vxw vvy.a(com.google.android.gms.plus.service.v2whitelisted.models.Person, vxw) took 218.930ms
01-21 17:59:47.835 W/dex2oat ( 1934): Compilation of java.lang.Object vzb.createFromParcel(android.os.Parcel) took 122.351ms
01-21 17:59:47.914 W/dex2oat ( 1934): Compilation of boolean wba.onTransact(int, android.os.Parcel, android.os.Parcel, int) took 148.665ms
01-21 17:59:50.360 W/dex2oat ( 1934): Compilation of java.lang.Object yai.createFromParcel(android.os.Parcel) took 138.632ms
可以很清楚的看到dex2oat 解包gms相关的apk,花费好多时间。
下面就是如何处理这个dex2oat问题
+++ b/device/rockchip/common/BoardConfig.mk
# Enable dex-preoptimization to speed up first boot sequence
ifeq ($(HOST_OS),linux)
ifeq ($(TARGET_BUILD_VARIANT),user)
ifeq ($(WITH_DEXPREOPT),)
WITH_DEXPREOPT ?= true
endif
endif
endif
要么使用user模式编译系统,要么强行WITH_DEXPREOPT ?= true
可以让系统第一次开机时间缩短到2分钟之内
另外对单个apk进行开机速度优化方法如下
apk目录下的Android.mk中添加
LOCAL_DEX_PREOPT :=true,表示优化该apk
LOCAL_DEX_PREOPT :=false,表示不优化
另外可以在系统编译dex_preopt_odex_install.mk对apk加LOCAL_DEX_PREOPT :=
+ifeq ($(LOCAL_MODULE),helloworld)
+LOCAL_DEX_PREOPT:= true//false
+endif
built_odex :=
installed_odex :=
built_installed_odex :=
这样,就可以在out目录apk的目录生成oat目录
郑重声明:本人原创博文,都是实战,均经过实际项目验证出货的
转载请标明出处:攻城狮2015
有需要可以加VX