How to build optimized Intel XDK Crosswalk app properly?

XDK_properly_1200x500

Many people complain about the Intel XDK Crosswalk performance. The real problem is that most of them simply don’t know how to make an app with Intel XDK properly. Crosswalk is based on Chromium and with Intel XDK build system we can (and should) set the proper options for compilation.

Construct 2 Cordova export

If your Intel XDK project directory looks like this then it’s not good.

dir1

When exporting project as Cordova, Construct 2 generates intelxdk.config.additions.xml file. The problem is that Intel XDK also generates and uses this file. By exporting Construct 2 project into main Intel XDK project directory, you simply overwrite this file every time.

It’s recommended to create a separate directory under main Intel XDK project directory and save Construct 2 export into this new one. I use www directory as suggested by Intel XDK.

My Intel XDK directory looks like that.

dir2

There is no mess and I’m not overwriting any XML file.

Alright but why do we want to keep intelxdk.config.additions.xml file untouched? Because we will set up some compilation options there.

Setting up intelxdk.config.additions.xml

Open intelxdk.config.additions.xml file with any text editor you have. Depends on the plugins you use in your project, you will see some XML nodes inside.

Something like this.

xml

Any third party plugin should be set directly in Intel XDK via Plugin Manager, so we don’t need those entries here. Select everything and delete (CTRL + A, DEL). We want to have a clean file.

Now paste there this code.

 

Nothing else should be there (unless you know what you are doing). Save file. Now you can build your project.

So what are those mysterious commands? Simply saying they tell your app how it should behave in specific situations. The most important option is –ignore-gpu-blacklist. With Cordova CLI 4.1.1 it was set up by default, but from CLI 5.1.1 up we have to do it manually.

As Paul F. (Intel) said:
“Including that line will fix the performance issues for 99% of Construct2 Crosswalk builds with the Intel XDK. ”

So I would say that it is a mandatory setting for each build.

Content of this article is a part of my Improve your game performance by up to 400% e-book. If you’d like to read more about performance optimization in Construct 2, consider buying my e-book in Scirra Store [LINK]. Please keep in mind that you can always ask Scirra for a refund if you won’t be satisfied with the content.

5 comments to How to build optimized Intel XDK Crosswalk app properly?

  • chadorireborn  says:

    Great Information… I honestly did not know about the code… Thanks for sharing.

  • Lucky Rawat  says:

    Hi Toby R
    I have a request for you
    I did not find any tutorial regarding official Google Play Service
    How to use that plugin
    how to put leaderboard & achievements
    Please make one
    there are other tutorials like cocoon.io

  • Jimy  says:

    Can thi solve the size apk problem? I just test make simple game from construct 2, under 2 MB but after compile with intel xdk the apk file size increase to 22MB. please help me how to reduce size my apk?

    • Toby R  says:

      Hi Jimy! There is nothing to optimize. Your APK contains your app (2MB) and the Crosswalk browser (~20MB) which is needed to run your game properly on every device. If APK size is really so important for you then you might want to use Android WebView (simply don’t wrap with Crosswalk using Intel XDK) or different wrapper like CocoonIO.

  • Tetriser  says:

    A nice tutorial for Intel XDK and Crosswalk.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">