Hot Reload iOS Simulator



Been playing around with Defold for a couple of days now and enjoying it so far. I was trying to get Hot Reload working in the iOS simulator, but have been unsuccessful. I am able to package a debug build and get it running on the simulator, set it as a target, and even seem to communicate with it by running Project -> Build (which makes the app stop). But running Hot Reload (or cmd + R) produces no change. I verified that it works fine with the desktop app. Maybe I need to attach first somehow?




Does the console say that it reloaded the file?

I’m not sure if we support hot reload on the simulator. My gut feeling says that it should work though. @sven do you know if we ever tried hot reloading on the iOS simulator?



I tried launching to a target running inside a iOS simulator, and hot reloading while developing the feature, so it should work as far as I know.

Did you first launch (ie selected it as a target then building) the game to the running instance first, before trying to hot reload?



Hmm I’m pretty sure I did. Should I be seeing output from the game in the console window (I’m not, which makes me think that’s part of the problem).



Maybe the problem is that it’s not actually re-launching it in the simulator when I build (cmd + B), it’s just closing the previously running instance. And I try to build without it already running in the simulator, I get an error box saying “Connection Refused”. Is there a proper way to launch into the simulator directly?



Just tried it here on my machine, seems to work:



Interesting, yes I’m following the same steps here but in my case, when I select Project -> Build, the editor shows


but back in the simulator, the app is simply closed and it’s sitting on the OS home screen. It’s not establishing that initial connection, which appears to connect the console to the log output, etc. in your case. I’ll keep playing around with it, maybe there’s a problem with the way I built the iOS simulator package.



So what you are saying is that once you started the game in the iOS simulator, you select it in the target meny, press Project>Build and then it exits out to the home screen?

In that case it sounds like a crash, and it occurs somewhere in the “reboot” step of the engine. It could be something isn’t properly handled in either shutdown or start of the engine code and depending on how the game is setup… Could you try creating a new empty project and do the same steps, does it work?



Yep, precisely.

Tried it just now, with a completely empty project, and then again with an empty “mobile” project, same result both times (crash / exit to simulator home screen).

In case it’s relevant, here’s my simulator version info:
Version 11.1 (SimulatorApp-912.1 SimulatorKit-570.3 CoreSimulator-681.5.4)

And my Mac OS version:
Mojave 10.14.6

In order to get an initial build onto the simulator, I’ve been selecting Project->Bundle->iOS Application, then unchecking Sign Application, 32-bit and 64-bit, checking Simulator, ensuring variant is set to Debug, then pressing Create Bundle. I then drag the generated .app file into my simulator and “tap” it. From there, my steps are just as in your video.

1 Like