3 ms·
Why don't we have code hot swapping on mobile?
- nathanpc 14y agoInteresting article. I would love to see less limitations on mobile development.
- ensmotko 14y agoI agree. For me code swapping is such an important feature. I can't imagine how people are doing game development without it. On the other hand, there are a lot of games for mobile devices, so I guess it's not impossible...
- pjmlp 14y agoLike we always did. Compile, re-deploy
- archivator 14y agoActually, it's not so bad. Libraries like libgdx allow you to target native Java and the phone via the same API. You can easily do 99.9% of the development on your PC and then deploy to phone to fix a few shader bugs here and there and be done with it.
- wsc981 14y agoOn iOS a system could be build to support some form of hot code swapping. Reason being that application can load NSBundle objects at runtime and NSBundles can contain (among other things) executable code. Sadly, Apple doesn't allow apps to use this in release versions, as apps could more easily exploit potential flaws in the system this way, since one could bypass Apple's approval process. More info on NSBundles here: https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/Reference/Reference.html https://developer.apple.com/library/ios/#documentation/Cocoa... Apparently a more "low-level" approach is possible as well, but again not allowed by Apple: http://stackoverflow.com/a/10509453/250164 http://stackoverflow.com/a/10509453/250164
- zdw 14y agoMost likely security. While this is handy for development work, the temptation to leave it in the final version ("Hey, it works now, why 'fix' it?") would be pretty high.
- ensmotko 14y agoYes, but couldn't this be handled by the OS? You could have a special option in the development tools, that allows you to run hot swappable apps.
- archivator 14y agoIt already exists. The manifest has a "debuggable" flag that allows for a remote debugger to attach to a running app. Nothing on the Play Store is debuggable.
- willvarfar 14y agoAs I recall from my distant Android app development, you could redeploy to your phone (connected via a USB cable) in seconds, and it was never a big hindrance. You typically just have a 'cheat code' to take you to any level or whatever so you are never far play-wise from where you want to be debugging.
- ensmotko 14y agoYou are right. Deploying takes seconds + a bit more to get to the state you're testing. This isn't bad, it's actually quite amazing when you think about it. But compared to instant feedback, it's in a completely different ball park.
- zidar 14y agoOkay, but let's say you want to test a few looks. You tipically change back and forth and make small changes, so a few seconds for the redeploy, and mabe a few clicks here and there to get to where you want to be. That might take 10s each time. So testing if what looks nicer is is a matter of instant change and 10s per change and extra clicking all the time. I personally don't like repeating anything more than 5 times if it's not necesery. If the state that you're in is more coplicated, you might need to type something, log in and do some crazy stuff to get to where you're debuging, then you see how much more anoying that gets.
- johnno1962 14y agoIn fact there are some solutions out there for code injection using bundles on iOS, e.g. the following video: http://vimeo.com/50137444 http://vimeo.com/50137444 It packages it all up as a plugin for Xcode.
- josephlord 14y agoYou can also run arbitrary code from the standard debugger although it may not be possible to actually change the code substantially it can be useful for exploring and experimenting.
- comex 14y agoIt's not just mobile; the only implementation of hot swapping for C I know of is MSVC's debugger, so I'm out of luck as an OS X and Linux user. Would be cool to implement.