Debugging
At that time, when I needed to find a bug on Android, I had to build the web app, build the Android app with Cordova, launch it on a device or an emulator, launch chrome dev tool to connect to the running app, put my breakpoints, find a possible cause, fix it in my code and do this process all over again. This whole process was taking way too much time.
1 | $ cordova platform add <platform> |
iOS emulators list
1 | $ cordova emulate ios --list |
To emulate iOS 12+
1 | $ cordova run ios --emulator --target="iPad-Air-2, 12.1" --buildFlag="-UseModernBuildSystem=0" |
Run on a device
1 | $ cordova run android --device |
Use emulator with VSCode and live reload (Ionic)
https://geeklearning.io/live-debug-your-cordova-ionic-application-with-visual-studio-code/
iOS
https://developer.apple.com/download/more/
https://download.developer.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip
Android
Cordova Android
https://cordova.apache.org/docs/en/latest/guide/platforms/android/#setting-environment-variables
How to create AVD
https://developer.android.com/studio/run/managing-avds#viewing
Android Emulator
https://developer.android.com/studio/run/emulator#about
Start the emulator from the command line
https://developer.android.com/studio/run/emulator-commandline
Threading
Threading in Android Java:
1 | - (void) create |
Cordova plugin Android threading
https://stackoverflow.com/a/28980819
Threading Cordova plugin iOS
https://cordova.apache.org/docs/en/latest/guide/platforms/ios/plugin.html#threading
iOS and Android difference
1 | Plugin methods ordinarily execute in the same thread as the main interface. |
but on Android:
1 | The plugin's JavaScript does not run in the main thread of the WebView interface; instead, it runs on the WebCore thread, as does the execute method. |