Remote-packaging for iOS fails on Windows 10 [including proposed fix]

I’m on UE 4.9.1 and have followed this guide:

[Windows -> iOS Rsync/Remote Build Guide (4.8) - Mobile - Epic Developer Community Forums][1]

You can read in my post on that thread that I had a problem with file permissions on the Windows 10 PC, but there are also problems with file permissions on the Mac that require modifying the UE code. Some of the files that are created on the PC and then copied to the Mac for building and packaging are, for some unknown reason, created with no permissions at all on the Mac. No one can read, write, or execute them. This makes the packaging process fail on the Mac. The fix I have found is to force the files to be copied with full permissions:

Engine\Source\Programs\UnrealBuildTool\ToolChain\RemoteToolChain.cs

In function:
static public bool UploadFile(string LocalPath, string RemotePath)

Replace:

			// make simple rsync commandline to send a file
			RsyncProcess.StartInfo.FileName = ResolvedRSyncExe;
			RsyncProcess.StartInfo.Arguments = string.Format(
                "-zae \"{0}\" --rsync-path=\"mkdir -p {1} && rsync\" '{2}' {3}@{4}:'{1}/{5}'",
				ResolvedRsyncAuthentication,
				RemoteDir,
				ConvertPathToCygwin(LocalPath),
				RSyncUsername,
				RemoteServerName,
				RemoteFilename
				);

with:

			// make simple rsync commandline to send a file
			RsyncProcess.StartInfo.FileName = ResolvedRSyncExe;
			RsyncProcess.StartInfo.Arguments = string.Format(
                "-zae \"{0}\" --rsync-path=\"mkdir -p {1} && rsync\" --chmod=+rwx -p '{2}' {3}@{4}:'{1}/{5}'",
				ResolvedRsyncAuthentication,
				RemoteDir,
				ConvertPathToCygwin(LocalPath),
				RSyncUsername,
				RemoteServerName,
				RemoteFilename
				);

\Engine\Source\Programs\IOS\iPhonePackager\SSHCommandHelper.cs

In function:
static public Hashtable UploadFile(string RemoteMac, string LocalPath, string RemotePath)

Replace:

			// make simple rsync commandline to send a file
			RsyncProcess.StartInfo.FileName = RSyncExePath;
			RsyncProcess.StartInfo.Arguments = string.Format(
                "-zae \"ssh {0}\" --rsync-path=\"mkdir -p {1} && rsync\" '{2}' {3}@{4}:'{1}/{5}'",
				SSHAuthentication,
				RemoteDir,
				ConvertPathToCygwin(LocalPath),
				SSHUser,
				RemoteMac,
				RemoteFilename
				);

with:

			// make simple rsync commandline to send a file
			RsyncProcess.StartInfo.FileName = RSyncExePath;
			RsyncProcess.StartInfo.Arguments = string.Format(
                "-zae \"ssh {0}\" --rsync-path=\"mkdir -p {1} && rsync\" --chmod=+rwx -p '{2}' {3}@{4}:'{1}/{5}'",
				SSHAuthentication,
				RemoteDir,
				ConvertPathToCygwin(LocalPath),
				SSHUser,
				RemoteMac,
				RemoteFilename
				);

After applying those changes the process runs perfectly, and I don’t think that any problems could arise from them.

Windows -> iOS Rsync/Remote Build Guide (4.8) - Mobile - Epic Developer Community Forums

Hey Leonardo,

Thank you for providing us all of this information. We are investigating this issue and your fix further, a will be entered once it’s completely verified. If you have any further questions, please feel free to reply back.

Thank you!

FYI - I experienced the same error - these steps seem to resolve that issue. My final problem with reomte build involves a code sign issue I am still troubleshooting

Thank you for providing us with this information. I have submitted a report referencing this AnswerHub post: UE-21409. Once additional information is received, we’ll update this post.

Thanks!

This issue has been fixed in 4.10!