iOS Simulator not refreshing with Cordova (PhoneGap)? Read this.

About a month or two ago I noticed something odd with my Cordova tests. I'd fire off a call to the iOS simulator by doing cordova emulate ios. The first time, it worked fine. But as I edited I noticed something odd. Subsequent calls to the emulator would end up in a blank screen in the emulator. If I watched carefully, I'd see my app load for a split second before going black.

Apparently, this is a bug with ios-sim, the command line tool used to talk to the simulator. If you know to check out the GitHub repo for it you will see a tip suggesting this command to fix it: killall launchd_sim

This works like a charm, and since I normally just "edit, alt-tab to terminal, click up, enter" in my dev cycle, I just switched my command to this: killall launchd_sim && cordova emulate ios

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA