Download

Debugging for all Mobile Devices is virtually impossible and totally undocumented...

Excuse my slight frustration vent, but having spent several months making a mobile title (which has now shipped), and still poking in the dark when it comes to trying to do something as simple as attach a debugger I feel like this at the stage where it needs urgent attention.

Currently, I am completely unable to attach either the Android Debugger to an Android Device in Visual Studio, and due to a mixture of lack of experience and zero documentation I’m also unable to work out how to attach the XCode debugger to an iPad too. Throughout development I feel like I’ve been facing an uphill battle with what should otherwise be a really simple task, but I am constantly fighting the engine when it comes to things like this. I thought my prayers were answered when this article came out, about attaching the Android Debugger via Visual Studio 2015.

However that also fails to work because the Package that Unreal builds out has duplicate keys inside it (whatever that means) - so Visual Studio rejects it. 4.12 has just come out, and we’re still supposed to be using CodeWorks 1R1 according to engine docs - which is well over a year out of date. There have been masses of improvements to the SDK since, but none have made their way across. The same seems to now be true to iOS as well. After ‘copious googling’, the only answerhub post I’ve found of any help is this one: Debug on iOS device - UE4 AnswerHub

However, once again I’ve come up short - and the users there are also complaining about changes that have been made that have made it more difficult to setup XCode properly. This basically means that if an issue presents itself on a device and not on the development PC (aka ALL the freaking time), you are completely helpless when it comes to trying to fix it. Or in our case, you have to spend hours adding ridiculous amounts of logging to your code to try and track down where crashes occur.

We’re currently experiencing a crash-on-launch issue on several specific iOS devices (iPad2 and iPad Mini 2), which is actually costing us sales and reviews. While normally this is easy enough to resolve, we now can’t attach anything to the debugger to work out why there is a crash and fix it. I don’t know if IOS debugging is as broken as Android or if it’s just my lack of knowledge of XCode, but I’ve been scraping through documentation and answerhub trying to find just a scratch of information, but have so far come up short.

I’m not alone on this either, several users in the Slack group have brought this up and it always ends the same way. This is actually really harming us, because we can’t fix any of these problems until this stuff works - or at least until there is some instruction on how to do it. I’d really appreciate some instruction here because we’re totally stuck until we can resolve this, and every day this goes by unfixed it’s costing us sales.

So I’ve hacked away at the xcode project settings, and have finally figured out how to ‘Start’ the debugger (but I really had to dig into this and experiment to get it working!)

Now once again my XCode knowledge is limited here - but it now seems to get stuck on a breakpoint that I haven’t set in Thread 2 > FICUInternationalization::Initialize();. I have no idea what this means, and the output log just says “ICU data directory was not discovered”.

If I continue through this breakpoint enough times, it eventually stops triggering - but the game never goes any further than the splash screen. So now it’s running, but not running…

Still fumbling around in the dark here… any ideas?

Screen Shot 2016-06-28 at 16.53.06.jpg

Do you mind sharing the process you discovered, and what you were hung up on?

Separately: I’m assuming the reference to the old CodeWorks is a documentation bug. I recently downloaded and installed the latest CodeWorks to support Unreal, and i could build and deploy a project.

Finally: I would highly recommend doing all of your development and debugging on the host (Windows or perhaps Mac or Linux) and only do tuning and qualification on the actual mobile devices. If you’re trying to use some mobile-only subsystems (Google Play, etc) then add lots of logging in the code that calls it … Not great, I know, but at least that lets us make progress.

CodeWorks for Android 1R4 is what you should be using; an installer is in Engine/Extras/AndroidWorks in 4.12. This includes the latest Nsight debugger plugin for VS2015. I use it daily so I know it works, but there are some phones it may not work with (this is a gdb issue in most cases).

It is easiest to use a code project so you have it in the solution. Just make sure you have already installed the data files needed (either by launch-on for loose files… works well if only one map, or an previously packed OBB). It is possible to debug a content-only, too, but you’ll want to override the APK in the debug settings (right-click on UE4, select properties, and set the override APK). You’ll need to do this so the package name is correct (point it at the Project’s Binary directory APK after packaging). Use F5 to start and skip updating.

Please note you may see a SIGILL at start; if you do, just continue.

Yeah I’m using 1R4 anyway now. I get further but it still fails, we’ve tried nVidia Shield and an Xperia Z3. It is a code-project, but I have to add the .apk manually for some reason…

The biggest problem at the moment is the iOS debugging. So far It just gets stuck on that first breakpoint I posted above (whatever it is) and doesn’t move on from there so until I can get past that I can’t solve our crash issue (or at least work out what it is).

You will need to cook the data for the game and then run the packaging. I would suggest building the game first with File|Package in the editor. This will cook everything and create an IPA. It will also put all of the cooked data in the correct spot for installing when trying to debug from Xcode. Then, run your xcode debug like before. It will install the data to the device and you will then get past that particular failure (where it’s trying to read the ICU data in for initialization of the localization system and its not finding it on the device).

Thanks @Ravlek, I’ll try this

Is it important to package the content to a particular directory? I usually always package to desktop for example.