Tuesday, July 31, 2012

Tutorial: Enabling Nitro Javascript in your iOS app directly from Xcode

Apple doesn't allow 3rd party developers to use the super fast Nitro Javascript engine. Only apple's own apps like Safari and iBooks use the engine.

Ever wondered if you could use it? Well its actually pretty easy, you basically have to follow two easy steps:

1. In your Xcode project setting select the application target. In the summary scroll down until you see the 'Entitlements' section. Then enable the entitlements, thats pretty much it for step 1.

2. In your project navigator you will see a new file AppName.entitlements . Open that file and expand the 'Xcode Entitlements' dictionary. Add a row by right clicking anywhere in the document and pressing 'Add row'. 

Next type 'dynamic-codesigning' into the newly added row. Set the type to Boolean, then set the value to YES. 

The 'dynamic-codesigning' will enable the nitro javascript engine for your app, my results with the sunspider javascript speed test show that the Nitro Javascript engine increases the Javascript loading times by ~400%, thats quite a lot! I haven't tested yet if apple will allow this in the app store, but im pretty sure the wont. Let me know if you tried it!

Speed test comparison:

This is the sunspider speed test which showed me the 400% speed increase with the Nitro engine: http://www.webkit.org/perf/sunspider-0.9.1/sunspider-0.9.1/driver.html


  1. Will this somehow help boost the responsiveness in protube hd upcoming version? As current version of protube hd is very unresponsive/crashy/laggy when it comes to the initial video loading it's hit and miss compared to the default YouTube apple ap

  2. Thank you for your Protube app me and family enjoy,but im having a little issue with when i did the update its no longer letting me play Mp3 in the background how it would before

  3. Is the background issue a bug that you will be fixing?

  4. I can't make it run on my un-jailbreak devices. Xcode throwed an error of "The executable was signed with invalid entitlements"

  5. This comment has been removed by the author.