Launching on iOS failed

Today I was able to launch from the PC to iPhone 6 Plus. The build was successful and the ipa installed to the phone but the app needed to be manually started.

I iterated over several changes and launches and came to realize that while subsequent builds were successful, the ipa on the device was not getting updated with my changes. Several attempts to launch after deleting the app off the phone resulted in the Deployment Server crashing again. I restarted the phone and UE4, failed to get a launch done, and finally made a iOS package and installed the correct ipa via iTunes.

Trying to launch again after a minor BP change has failed. But I just noticed something odd. I currently have the iPhone 6 Plus cabled to the PC and have for this entire session. The iPad is on wifi and I’m not currently testing with it but have been picking it up to kill time during builds. But the iPad seems to be a target:

   LogPlayLevel: DeploymentServer: [DD] Trying to connect to mobile device running iOS ...
   LogPlayLevel: DeploymentServer: Connect: Couldn't Start AFC service
   LogPlayLevel: DeploymentServer: [DD] Mobile Device ' Six Plus' connected
   LogPlayLevel: DeploymentServer: Device 'iPad Air' with id 1782b1522f7b2axxxx6ac77 is being checked against .
   LogPlayLevel: DeploymentServer: [DD] Transferring IPA to device 'iPad Air' ...
   LogPlayLevel: DeploymentServer: Directory (PublicStaging) doesn't exist!
   LogPlayLevel: DeploymentServer: CreateDirectory (PublicStaging) failed
   LogPlayLevel: DeploymentServer: Connect: Couldn't Start AFC service

If I unplug the iPhone then the launcher does not attempt to use it as a launch target over wifi. However the launcher will always attempt to use the iPad if wifi is enabled - and this is when the DeploymentServer crashes and the PublicStaging directory can not be created. Plug the iPad in to the PC and the crash seems to disappear. The obsolete ipa gets installed to the connected iPad on the second launch attempt (the first attempt results in an ipa that will not start).

Trying to solve the obsolete ipa problem, I’ve deleted the file from iTunes and the devices. When I try another launch the ipa in the binary directory has been touched with the current time but is still obsolete and gets installed to the device yet again. The obsolete ipa has green debug text printing on the screen and my updated version (as will play in PIE) has red text.

So maybe one of these problems occur when an UE4 installation has launched to multiple iOS devices in the past and DeploymentServer is inappropriately or incompletely attaching to non-cabled devices?

Ok, so we were able to reproduce some of this today here at the office. In our case, we enabled sync over Wifi and then launched the editor. The device showed up in the editor on the Mac and when we tried to deploy to it we got the failure. Do you have Sync over Wifi enabled for the iPad? What about the iPhone 6+? If you have it enabled, can you try disabling it and then see if the deploy works correctly?

-Pete

Both iPhone and iPad are historically and primarily synced with the Mac. WiFi sync was enabled but it hasn’t been functional in months. The iDevices claim I need to cable them to the Mac and then press a button to enable wifi sync. However in iTunes on the Mac the iDevices are often detected via wifi and the wifi sync option is selected but sync is impossible without connecting a cable. The last sync / backup to the Mac looks to be in May.

To transfer ipa files from PC to the iDevices, I’ve authorized the PC for my Apple account. Cabling to the PC lets me sync and it seems like the only thing touched on the iDevices is the ipa transfer. All the other files / music / apps / settings are maintained from the Mac and don’t reflect the empty status of my PC iTunes.

I never enabled wifi sync for the PC to iPad or iPhone (from the iDevice end or from iTunes). However since the iDevices had been most recently cabled to the PC…

This morning with both the PC and Mac turned off, I checked wifi sync status on both iDevices. Both said the PC was unavailable and that wifi sync could enabled with a cable connection. Booted the Mac. After some time passed the iDevices switched to say the Mac wasn’t available and that I needed a cable to start wifi sync.

I connected both iDevices to iTunes Mac and deselected the WiFi Sync option in iTunes. Double checked the option is off on iTunes PC. It should also be said that both iTunes are set to iCloud backup - so there is no local backups made to PC or Mac.

Launching from PC with nothing cabled - DeploymentServer is reaching and crashing when handling the iPhone over wifi. Put the iPhone into airplane mode and the launch fails with no devices available. Turn airplane mode off and crash is still gone.

The individual devices do not appear off the Launch icon or Device Manager on the PC - I’m always using ‘All_iOS_On_David-PC’ and don’t know how change it.

iTunes version on both: 12.2.1.16

Ok, so when you disabled the Wifi sync, did you connect the device to the PC with a cable and try to deploy? Similarly, for the Mac. The All_iOS_On_XXX on PC is normal, as we don’t detect the devices on PC. We assume a device is attached. That will be rectified in a future build.

-Pete

Did more testing today. I can currently deploy to either cabled device from PC and Mac when wifi sync is disabled. It might be necessary to reset the device radio after disabling wifi sync (toggle airplane mode or reboot).

Network deploy isn’t working for me. iPad plugged into PC, deploy from Mac to All_iOS_On_XXX results in message ‘timed out while trying to connect to a mobile device.’ Plug iPad into Mac, deploy from PC to the iPad detected / shown in the launch menu results in the same message. In both cases the network devices are visible to the network without sharing the devices first. But the launch fails if the device is or isn’t shared.

I think I have the same, or a related issue. Changing the Wifi Sync option did not help (it was off to begin with).

However completely disabling Wifi on the iPhone seems to solve the problem for me.

I got the same error messages with all the versions of UE4 I tried (4.7.6, 4.8.3, 4.9.0 P1). When Wifi on the iPhone is ON and the game has not been deployed to the device previously, I get these logs:

Logs

With Wifi OFF I am able to successfully deploy and play the game to the device.

Turning Wifi ON again, after a previous successful install will result in slightly different logs (the process seems to hang, instead of returning with an error):

Logs

Turning Wifi OFF again, will result in a successful install again.

I’m using an iPhone 5S with iOS 8.3 and I’ve been mainly experimenting with just the Blank BP template project.

Thanks that worked for me !

I had similar logs as the OP, with Connect: Couldn't Start AFC service, and System.IO.IOException: AFCFileRefOpen (/PublicStaging/MyProject.ipa) failed with error 7. This is UE 4.9.2, OS X 10.10.5, iOS 9.0.2, iPad 3rd gen.

I fixed it by disabling wifi on the iPad, unplugging the cable and plugging it back in, and re-deploying. I presume that the first time it was trying to sync over wifi even though the cable was in. I don’t know if I’ve ever had wifi sync work (I’m new to this) but cable sync seems to work fine.

Ewan, thank you so much! This was the exact fix for me as well!

Did it for me, too! Thanks a lot this one was driving me nuts the last two days!

So originally, Ewan Mellor’s fix worked for me. However, I am now trying to launch on my iPhone 4s running iOS 8.4.1 from Unreal 4.10.4, and I’m getting the exact same message as OP.

I’ve tried restarting the iPhone, copying the project to UE 4.11.2 and launching from there, freeing up space (I have almost a gig), and updating the info in Project Settings > Platforms - iOS to not be blank. Any suggestions?

Thank you,
Chris

I’m having this exact issue! Could get the game on the phone perfectly fine the first time and now suddenly it just disappears immediately after installing a new build.

For me it was a crappy aftermarket iOS lightning cable. As soon as i used the OEM it worked perfectly. The aftermarket ones, even the ones that show up properly, etc for some reason fail randomly.

For me it was a crappy aftermarket iOS lightning cable. As soon as i used the OEM it worked perfectly. The aftermarket ones, even the ones that show up properly, etc for some reason fail randomly.

My hero; thank you.