iOS cordova app performance profiling - ios

We have built a hybrid app for iOS using Cordova and now we would like to do some performance profiling in the actual device (specifically around Javascript execution time, DB access times etc). Are there any tools available in iOS that can be used for performance profiling of such apps ?

Microsoft has some documentation on measuring the performance of Cordova apps, including on iOS. It involves using Safari on desktop to connect to the Webview on iOS, and use the JavaScript timeline profiler:
https://learn.microsoft.com/en-us/visualstudio/cross-platform/tools-for-cordova/tips-workarounds/measuring-performance?view=toolsforcordova-2017

Related

Technical differences between PWA and Hybrid App

What are the differences between a PWA and a hybrid app? This question was asked before but I haven't found found a proper answer to my question.
I know a PWA runs in the browser and you get a hybrid app from an app store.
But both are using JavaScript with HTML and CSS and both enable offline support and I can access native features like camera and local storage.
Once I have added a PWA to my Homescreen, it uses a web view to render the app right? And a hybrid app uses a web view as well, so what exactly are the differences between PWA and a hybrid app?
With Ionic I can even use the exact same code for a pwa and a hybrid app...
Roughly it is like this below:
web app (PWA) is just a web-site that declares certain capabilities using manifest file etc which can get it some special treatments (like leverage service worker, sign up for web notifications, go full screen etc IF target browser supports it). As a web-app it is super limited in its "privileges" on a system level (like persistence quota etc)
hybrid app (like Cordova for example) is a binary code that is "wrapping" your web-code and exposes certain "native" SDK capabilities via plugins. You can potentially also write your own plugin and in theory access any native SDK API this way. But since your main app code is still a web-app that runs inside of a webview it still has a lot of penalties like performance etc. But at least you can get things like storage etc.
native app is a binary build using target platform's SDK. That in
theory gives you max access to capabilities and performance at
expense of having to write separate code for each platform.
Makes sense?
Progressive Apps
Today, these apps only work on Opera, Chrome, and the Samsung mobile browser. However, these browsers take up only less than half of the mobile browser market.
In some devices, some of the features will not work. For instance, notifications on iOS devices will not work.
In some apps, cameras, fingerprint scanner, and GPS may not work or work with glitches.
Cordova/ Ionic based hybrid apps
Making the hybrid apps run efficiently on multiple platforms is no easy task. In some instances, it could cost almost the same as running native apps. The cost will depend on how close you want to get to the native app experience.
Since these apps will launch using a browser-like component, they are only as good as the component on which they run. Earlier, Google and Apple did not agree on the WebView. While it has vastly been improved, it does not have the same efficiency as running a native app.

Mobile app logging stats tools - Swift

I am developing a mobile GPS tracking app and I would like to know if there are any classes available that output the mobile stats to a view? Memory, CPU etc. Similar to Hi-res-Stats in AS3.
I would like to see usage while the app is used however the only tool I know of is built in to xcode and it wouldn't really be feasible taking my mac with me.
Thanks

Why does wkwebview run slower in cordova compare to mobile safari?

I've built an app using famo.us which runs very nicely in the native ios 8 browser and also this app: https://itunes.apple.com/us/app/webview-wkwebview-uiwebview/id928647773?mt=8
The app in the link allows you to test the performance in both UIWebView and WKWebView.
I've noticed after profiling in instruments that my app uses about 30-40% more cpu in cordova than when running in the app above. I have tried using both UIWebView and the experimental WKWebView plugin from Telerik. I have even tried pointing cordova directly to a webserver with the contents of my app.
No matter what I strip out or try, my app runs considerably slower in cordova. If cordova and the app store app use the same webviews (presumably), why would the former consume so much more cpu?
Any insight into where the overhead is in cordova would be greatly appreciated.
Thanks!
We've found that adding a (almost hidden) UIToolbar to the cordova project (to the MainController.view) improves performance. Strange but true...

Performance monitoring tool for mobile safari web application

I am working on a web application. I can test my performance of web app including memory and cpu usage in desktop using chrome Dev tools. I want similar application so that I can measure my web app performance running on iPad and iPhone in safari.
Is such type of tool available?
PS: After some research, People advising for xcode instruments. but I am not able to recognize how I can test using instruments.
Please help.

What size can my iOS apps be with PhoneGap (Build vs. xCode)?

I'm trying to find out the specifics about app size limits for PhoneGap Apps. There seems to be a lot of conflicting information and I was looking for something up to date.
I've looked at this question: phonegap IOS application size and between it and a few other sites that I've seen it looks like I can use PhoneGap Build for apps up to 10-15MB, or a native app through xCode up to 2GB, but I've been unable to ascertain whether there is a size limit for PhoneGap Apps built through xCode using the PhoneGap/Cordova libraries.
I'm looking into options for the distribution of an app and need to decide whether the app is distributed with links to streaming videos (Vimeo) - app size ~40MB or whether to include the videos as part of the distributed application - app size ~600MB.
Thanks for your time and help.
Cheers,
-Ryan
PhoneGap apps that you build locally via Xcode have exactly the sae size constraints as native apps. The current limit is 2GBytes - see the following:
Max size of an iOS application
The only reason PhoneGap Build imposes its own limits is because it is a web / cloud based service.

Resources