You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Alexander Vakrilov edited this page Apr 28, 2017
·
9 revisions
Note: this functionality may change in future
NativeScript runtime for Android provides __startCPUProfiler and __stopCPUProfiler global functions which help you to profile your JavaScript code. To enable these methods you need to set the profilerOutputDir key in your app/package.json next to v8Flags inside the android section:
__startCPUProfiler("myprofile");// some JavaScript code__stopCPUProfiler("myprofile");
This will create a new file with the following naming scheme /sdcard/<package name>-<profile>-<timestamp>.cpuprofile. For example, if your application package name is org.nativescript.app1 then the output file will be named something like org.nativescript.app1-myprofile-19388793.672149.cpuprofile. Once you have a *.cpuprofile file you can pull it from the device with adb pull command. In our case the command will be:
NOTE: If there is not .cpuprofile file generated - try giving the app the storage permission explicitly by going to settings -> app -> <myapp> -> permission and enable the storage permission.