iOS builds no longer work

Using Unreal 4.6.1 on Mac also reprod on 4.6.0.

Until recently our project has built for iOS (on a Mac) with no problem.
For the last few days we have been unable to build iOS at all (through the editor or Xcode).
Building other formats (Mac, Windows, Android on Windows) still work fine - we haven’t yet tried building iOS on Windows.

We get an error during iOS builds:
LogPlayLevel:Display: env: Testing failed:
LogPlayLevel:Display: env: Test target UE4CmdLineRun encountered an error (The file ???.app??? couldn???t be opened because you don???t have permission to view it… You don???t have permission.)
**LogPlayLevel:Display: env: xx TEST FAILED xx **

(Note: ??? above are verbatim)

I have tried creating a new empty project and migrating the assets, code and config from the old project to the new.
I now have a new project folder that has no diffs from the original (I’m using DiffMerge to check that) and this project builds to iOS with no problems.
Obviously this isn’t a workable solution, aside from anything else it would destroy our source control.

I have tried deleting the original project folder and getting it again from source control - the error still occurs.

I have tried making a duplicate of the project folder (just duplicate it under Finder) and the error still occurs in the duplicate.

So now I have two folders, side-by-side, with identical contents, one works on iOS one doesn’t.

The Xcode project (project.pbxproj) created by the original project contains instances of the following line in all configurations:
CONFIGURATION_BUILD_DIR = “/Users/Shared/UnrealEngine/4.6/Engine/Binaries/IOS/Payload”;
These lines appear to always follow a correct-looking line:
CONFIGURATION_BUILD_DIR = “Engine/Binaries/IOS/Payload”;
within the same configuration block.
The new project folder project files do not contain these additional CONFIGURATION_BUILD_DIR entries, just the correct relative-path versions.
I understand that the project file is probably not used during the build tool execution but it indicates a problem.

What I believe is happening is that part of the build process is occurring in the wrong folder.

After a build I have a .app folder in two locations; one is in the Binaries/IOS/Payload/ folder in my project directory, the other is in the UnrealEngine/4.6/Engine/Binaries/IOS/Payload/ folder referenced above.

It looks like the copy of the info.plist and embedded.mobileprovision files are happening in the latter, while most of the processing is correctly happening in the former.

Using the migrated copy we get no reference to the UnrealEngine/4.6/ folder structure, everything happens in the project folder.

All this suggests that there may be something outside of the project folder structure that inputs into the build process, although since whatever it is that is going wrong happens on multiple machines it would have to be something generated by the project.
To check this I deleted the Unreal 4.6 folder (/Users/Shared/UnrealEngine/4.6) completely and re-installed Unreal but the problem persists, so perhaps the problem isn’t in the engine install folder.

Note that all of this is completely reproducable with this project.

Anyone have any ideas?

I have the same issue on two different Macs (one with a 1h old fresh Yosemite installation)

Do you have any plugins in your project?

According to Epic this might be due to a bug they have fixed in 4.7
If your .uproject file name is different from the containing folder (i.e. not name/name.uproject) then the game might be wrongly classified as a Program instead of a Game for iOS builds. Things go wrong at that point.