我正在使用 ionic 2、angular 2 和 typescript 构建应用程序.
I am building a app using ionic 2, angular 2 and typescript.
目前,已发布的应用程序(IOS 和 Android)在移动设备上的启动时间非常缓慢.
Currently, the released application(IOS & Android) boot up time very slow at the mobile devices.
即使是带有一些UI的启动模板在iPhone 6上也需要加载5秒,在oneplus 3上需要6秒.这个速度太慢了,不能接受.我的应用程序更复杂,需要大约 10 秒才能启动到首页.
Even the start template with some UI need to load 5 seconds at iPhone 6, 6 second on oneplus 3. This speed too slow and can't accept. My app is more complicated that takes like 10 second to boot to a front page.
我的启动应用程序的代码.
My code to start the app.
ionic start test --v2 --ts
启动时间能否提高到可接受的水平?
Can the boot time improved to a acceptable level?
Ionic 2 new RC4
改变了构建过程.现在可以使用 AoT 构建应用
Ionic 2 new RC4
changed the building process. Now app can be built with AoT using
ionic run android --prod
有关更多信息,请查看 ionic
For more info check out this issue on ionic
编辑
Ionic-cli
3 进一步模块化,cordova 命令需要ionic cordova
.所以你需要像这样运行它
Ionic-cli
3 further modularize it and cordova commands needs ionic cordova
. so you need to run it like
ionic cordova run android --prod
这篇关于Ionic 2 构建的应用程序(IOS、Android)在启动时很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!