Debug iOS from xcode

Ok, so I’m trying to debug a running on iPad application with xcode (because of crash on device only). This is what I did:

  1. I built editor with Win64 Debug Editor. In Packaging settings I set Build Configuration to DebugGame, checked “Full Rebuild” and unchecked “Use Pak File” (anyway, other configurations didn’t work either)
  2. I ran the UnrealRemoteTool on iMac, which is our build machine.
  3. Then on PC in editor I ran Launch “All_iOS_on_SKU145” (SKU145 is a computer name).
  4. Build and deploy went fine. The game is on device and it starts.

Now I can find the xcode project file on iMac in /UE4/Builds/SKU145/C/GameName/Binaries/UE4_FromPC.xcodeproj

I try to run a game using “GameName - iOS” scheme, but right after the start the game breaks at:

Assertion failed: HasFoundDataDirectory [File:/UE4/Builds/SKU145/C/UE4/Engine/Source/Runtime/Core/Private/Internationalization/Internationalization.cpp] [Line: 260] 
ICU data directory was not discovered:
../../../GameName/Content/Localization/ICU
../../../Engine/Content/Localization/ICU

The interesting part is that when I deploy a game using UnrealFrontend using Debug scheme the error is not occurring anymore. But then - project seems not to update after I make any changes in code.

I was trying to build an editor on iMac directly, but I had another problem (with Moga), but this is a material for another topic. But, will I be able to debug game on device when I have a editor on iMac?

Can I receive any guide to how debug running on iDevice application?

Having the same issue, haven’t been able to debug anything from 4.5. XCode is trying to debug the app without the content. It’s most likely looking for a pak file. All non-editor builds require pak files.

On my build from months and months ago, I used to be able to click Run in xcode and it would just run the app already deployed on my device. Now when I click Run it copies a new app to the device and runs it. The copy doesn’t have a pak file so it gets to the ICU data directory assert and stops.

Ok, after lots of tears and swears I found a solution that works for me.

The main problem is that on iMac there is only code compilation, not packaging. So on iMac in /UE4/Builds/SKU145/C/GameName/Binaries/IOS/Payload/MyGame.app there is a game without content. The content is cooked on PC.

On PC: go to the MyGame/Binareis/IOS and open MyGame-IOS-debug.ipa (it’s an archive, can be opened using 7zip). Then, go to the Payload inside this archive and get MyGame.app and copy it to the iMac on the place of old MyGame.app. Thanks to that we will have a bundle with content.

Other settings (packaging, building) are like in the question.

For safety - don’t deploy a game using PC with editor, deploy it using xcode. If needed, delete the app from device first.

Now I have to write some fancy script that will copy the payload to the good place. Doing this by hand might be annoying.

Ok, here is the batch script.

@echo off 
xcopy Binaries\IOS\%1-IOS-Debug.ipa Intermediate\IOS /Y
cd Intermediate\IOS
rm -r Payload
7z x %1-IOS-Debug.ipa
cd ..\..
start pscp.exe -pw %4 -r Intermediate\IOS\Payload %3@%2:/UE4/Builds/%5/C/%1/Binaries/IOS

It can be run with parameters:

Script.bat GameName MacIP MacUser MacPassword PCName

The script should be in the Game Directory. It requires 7zip and pscp.

I know it should be written in Unreal Build Tool, not batch file, but I totally don’t know what’s going on in UBT :frowning:

Anyway, I don’t know if it should be considered as bug.

Sweet, thanks for posting your script. Just a couple notes for anyone else trying it. Rm doesn’t seem to be stock in windows batch files, I ended up using del /Q /S Payload. I use pushd Intermediate\IOS and then popd instead of cd ….. . The /UE4/Builds/PCNAME/ will also vary based on where you have UE4 on your system. I have mine on H drive for instance.

I agree that it would be nice to have a built in automated way. It probably should be part of UAT’s buildcookrun program as it won’t have anything to work with until cooking is complete.

Forgot to mention that this did work perfectly for me. Debugging through xcode again :slight_smile:

We really need to make an unrealremotetool wiki page.