2017-06-29 80 views
2

我構建了一個Ionic 2應用程序,我想知道在應用程序啓動畫面期間發生了什麼精度?離子2:在啓動屏幕期間會發生什麼?

即使在此啓動畫面期間,您是否可以建議我使用高效的分析工具來分析應用程序的所有性能?

我的應用程序在生產模式下,在6秒內初始化(榮譽6x專業版)。我覺得太多了,你覺得呢?

感謝您的幫助!

我的config.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<widget id="com.ionicframework.myapp722890" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 
    <name>MyApp</name> 
    <description>Mobile version of MyApp</description> 
    <author email="my mail" href="https://toto/">toto</author> 
    <content src="index.html"/> 
    <access origin="*"/> 
    <allow-navigation href="http://ionic.local/*"/> 
    <allow-navigation href="http://my-ip:8100"/> 
    <allow-navigation href="*"/> 
    <allow-intent href="http://*/*"/> 
    <allow-intent href="https://*/*"/> 
    <allow-intent href="tel:*"/> 
    <allow-intent href="sms:*"/> 
    <allow-intent href="mailto:*"/> 
    <allow-intent href="geo:*"/> 
    <platform name="android"> 
    <allow-intent href="market:*"/> 
    <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/> 
    <icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/> 
    <icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/> 
    <icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/> 
    <icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/> 
    <icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/> 
    <splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/> 
    <splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/> 
    <splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi"/> 
    <splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi"/> 
    <splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/> 
    <splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/> 
    <splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/> 
    <splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/> 
    <splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/> 
    <splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi"/> 
    <splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/> 
    <splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/> 
    </platform> 
    <platform name="ios"> 
    <allow-intent href="itms:*"/> 
    <allow-intent href="itms-apps:*"/> 
    </platform> 
    <preference name="webviewbounce" value="false"/> 
    <preference name="UIWebViewBounce" value="false"/> 
    <preference name="DisallowOverscroll" value="true"/> 
    <preference name="android-minSdkVersion" value="16"/> 
    <preference name="BackupWebStorage" value="none"/> 
    <preference name="loadUrlTimeoutValue" value="60000" /> 
    <preference name="SplashMaintainAspectRatio" value="true"/> 
    <preference name="FadeSplashScreenDuration" value="300"/> 
    <preference name="SplashShowOnlyFirstTime" value="true"/> 
    <preference name="SplashScreen" value="screen"/> 
    <preference name="SplashScreenDelay" value="500"/> 
    <preference name="AutoHideSplashScreen" value="false"/> 
    <preference name="FadeSplashScreen" value="false"/> 
    <feature name="StatusBar"> 
    <param name="ios-package" onload="true" value="CDVStatusBar"/> 
    </feature> 
    <plugin name="ionic-plugin-keyboard" spec="~2.2.1"/> 
    <plugin name="cordova-plugin-whitelist" spec="1.3.1"/> 
    <plugin name="cordova-plugin-console" spec="1.0.5"/> 
    <plugin name="cordova-plugin-statusbar" spec="2.2.1"/> 
    <plugin name="cordova-plugin-device" spec="1.1.4"/> 
    <plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/> 
    <plugin name="cordova-sqlite-storage" spec="~2.0.2"/> 
    <plugin name="cordova-base64-to-gallery" spec="~4.1.2"/> 
    <plugin name="mx.ferreyra.callnumber" spec="~0.0.2"/> 
    <icon src="resources\android\icon\drawable-xhdpi-icon.png"/> 
</widget> 

我platform.ready功能:

platform.ready().then(() => { 
     StatusBar.styleDefault(); 
     Splashscreen.hide(); 
    }); 
+0

我不知道離子,但不是你編寫代碼在離子閃屏期間發生什麼? – Redman

+0

不,這不是我。我想初始化插件和組件,但我不確定。 –

+0

許多人通常在啓動畫面上保持延遲,以使其顯示一段時間。檢查你是否有任何延誤 – Redman

回答

0

建築用ionic build android --prod的伎倆。它大大減少了應用程序的初始化時間。

+0

我已經這麼做了。事實上,它在我的Android設備上大大減少了時間:14秒到6秒。但我想找出爲什麼我保留這6次。 –

+0

我認爲這取決於你的platform.ready代碼。也許你可以在這裏發佈,所以我可以看看它。 –

+0

你可以在這裏發佈你的config.xml文件嗎? – Gowtham