Quick Tip

Download iPhone Crash Log to PC

Following are the steps – Install iTunes on your PC. Connect your iPhone to your PC using its USB cable. Open iTunes. It will automatically recognize your iPhone. Click “iPhone” under “Devices.” Click the “Sync” button in the bottom right corner of the window. This will transfer all iPhone crash logs to your PC. Go to C:\Users\<User Name>\AppData\Roaming\Apple Computer\Logs\CrashReporter\MobileDevice. This will have a folder with your phone’s name. Go to your phone folder and then look for the app name whose crash log you are looking for.

Symbolicate iOS App Analytics Data

When a crash happens in an app, and we get un-symbolicated logs from a remote user, we need to first symbolicate it in order to find out exact reason of the crash. We need following items in in order to symbolicate a crash log Log file – This file can be taken from the real device on which app crashed. .app file – Download archive file (.ipa) to a folder and rename it to .zip. Unzip content and copy .app file. dSYM File – This file can be retreived from the app ipa file. Open XCode -> Window -> Organizer -> Find the Archive file, right click on the Archive file and click “Show in Finder” which will open .xcarchive file in finder. Right click on .xcarchive and click “Show Package Contents”. Go to dSYMs folder and copy dSYM file for the archive. Create a new folder on your mac and[…]

GADInvalidInitializationException: The Google Mobile Ads SDK was initialized incorrectly.

While running a cordova app for iOS, if following error is thrown *** Terminating app due to uncaught exception ‘GADInvalidInitializationException’, reason: ‘The Google Mobile Ads SDK was initialized incorrectly. Google AdMob publishers should follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to include the AppMeasurement framework, set the -ObjC linker flag, and set GADApplicationIdentifier with a valid App ID. Google Ad Manager publishers should follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist’ Make sure to include following values in your info.plist <key>GADIsAdManagerApp</key> <true/> <key>GADApplicationIdentifier</key> <string>REPLACE_YOUR_ADMOB_APP_ID</string>

Compile Cordova App for iOS

I recently planned to compile my Phaser games for iOS App Store. These games were build using Cordova CLI and have already been published on Android Store so I already have a functioning game which was to be ported to iOS. I decided to document the steps I had to follow to get my game compiled and published to iOS App Store. You can develop the game on any platform of your liking but in order to compile and publish these games to iOS App Store you do need to have a Mac. It can not be done from Windows or any other platform. Steps to compile the game: Download MacOS installer for Node.js and install it on your Mac. Go to App Store on your Mac and install latest version of XCode. You need XCode to build the game. Open Terminal console (Finder -> Applications ->Utilities) on your MacOS and install cordova using npm utility of Node.js by[…]

Cordova iOS Mobile App displays White Background Color after Splash Screen

Cordova Mobile apps display a white background right after Splash screen. This happens because WebView is loaded before our app is initialized. I tried many suggestions such as setting AutoHideSplashScreen to false and then call navigator.splashscreen.hide() in deviceready function which did not work for me. It gets called before WebView is even loaded. After trying a lot of things I finally had to look into the main view controller code which is automatically generated by Cordova (I am using Cordova 8.0.0). Go to MainViewController.m file in the platforms/ios/CordovaLib/Classes folder and look for following code – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. } Add the lines highlighted as below. I used a transparent Splash screen (which gives black background while splash screen is shown) and changed the background color of the WebView to the color which matched with my app’s background color. – (void)viewDidLoad { [super viewDidLoad]; self.webView.opaque=NO; self.webView.backgroundColor =[…]

Phaser Cordova Mobile App Crashing on iOS

I recently decided to compile Phaser games to iOS and publish to The App Store. The games were already published on Google Play Store for Android and worked without any issues. I faced few issues after compiling Phaser games for iOS. The first issue which I faced was the game crashing randomly on iOS. After doing further research I found this article on Intel XDK forum which turned out to be the reason for crash. The games were written a while back with older versions of Phaser and I did not get time to upgrade and test this with newer versions of Phaser (CE and higher) so I decided to try the fix specified in this thread and voila, it worked just fine. Here is the code which I borrowed from the thread var mygame; window.onload = function () { mygame = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, “mygame”); mygame.state.add(“Boot”, Boot); mygame.state.add(“Loading”, Loading); mygame.state.add(“MainMenu”, MainMenu); mygame.state.add(“TheGame”, TheGame); mygame.state.start(“Boot”); function onPause() { if(!mygame.paused)[…]