Build an app for dist-appstore, then without changing anything, build again. The build fails with:
The reason is that after the first build, the staging archive directory is MOVED to ~/Library/Developer/Xcode/Archives and then during the second build, Xcodebuild is NOT invoked and thus the staging directory does not exist.
The solution is to copy the staging archive directory to the Xcode archive directory.
Also, subsequent dist-adhoc builds fail because the intermediate files are deleted by the Titanium iOS build's differential build system.
Note that the generated adhoc IPA file was placed in a directory with the same name as the IPA file.
Since both adhoc and appstore builds switched to xcodebuild archive to accommodate Xcode 8.3 having removed PackageApplication, the differential build system is slightly broken and doesn't properly add/remove/update resources in the output archive. To fix this, we must invoke xcodebuild to force the staged assets to be copied into the output archive.