Unity3d OSX "Application can't be opened" - unity3d

I'm using a PC and I've created a build for Mac standalone.
I shared the file with my test user by zipping and emailing the build, but when he tries to run the application he sees this error:
The application "SomeApp.app" can't be opened.
After some searching, I learned that I need to do chmod to open the file. Can anyone tell me how to do that on a Mac?

The zip format doesn't have easy support for Unix-like file permissions, so your transfer process is stripping any permission flags that OSX uses to recognize files within that zip that are supposed to be executable. This can also happen with other file transfer solutions, so it's something to watch out for.
The best solution would be to create an archive which does keep those permissions, such as a tar archive.
Failing that, you can have a Mac user open a terminal and set the permission flag manually:
chmod a+x SomeApp.app/Contents/MacOS/*
(Replace SomeApp.app with whatever your .app folder is named)

I had the same issue, I left an answer here, at the bottom: https://forum.unity.com/threads/mac-build-breaking-when-uploaded-to-storage.1093330/
The problem was not with the .zip, but rather with the build itself. Ran fine on my Mac, did NOT run fine once I uploaded it and downloaded it again (or if anyone else downloaded it).
Edited 12/8/2021, as per EmiOB's suggestion, to add the text of my answer (same as in the link):
This worked for me on 2020.3.16f1:
In the Unity Editor: Build Settings, check the box that lets you make an XCode project (requires having XCode installed, I believe I have Xcode 11)
Open the XCode project
Build
That solved my problem :)

Related

UUID mismatch detected with the loaded library AFTER INSTALLING SPIRE when trying to run an App from XCode [iOS 5.0.1]

I've read about this argument here: UUID mismatch detected with the loaded library
The most voted solution didn't work for me, because I'm sure in my case the problem is Spire.
When I try to run my App [iOS 5.0 targeted] in Xcode 4.2 onto my iPhone 4 [iOS 5.0.1 JB] the output in the console is:
warning: UUID mismatch detected with the loaded library - on disk is:
/Users/myusername/Library/Developer/Xcode/iOS DeviceSupport/5.0.1 (9A405)/Symbols/System/Library/Frameworks/CoreLocation.framework/CoreLocation
unable to load symbol file: warning: Unable to read symbols for /Library/MobileSubstrate/MobileSubstrate.dylib (file not found).
warning: No copy of MobileSubstrate.dylib found locally, reading from memory on remote device. This may slow down the debug session.
Before installing Spire I didn't have any Xcode problem. I've read that somebody already found a solution: https://stackoverflow.com/a/8930742/1203837 but I'm not so practical in approaching the proposed one that I'm going to report also here:
If you have Spire installed and you updated to 5.0.1 you need to uninstall Spire or update dyld_shared_cache which Spire is using...Spire dyld cache is at /var/spire. You need to extract cache appropriate to your current firmware from ipsw.
I really would NOT uninstall Spire, so please help me to find out how to "update dyld_shared_cache which Spire is using" .
EDIT: thanks to kexik I've tested a fully working workaround for the problem.
Whatever device you have installed Spire in, here is the step-by-step guide (Mac OS):
download the original iPhone 4S ipsw ( link )
rename it from .ipsw to .zip
extract it (normally, by double-clicking it in Mac OS X)
download vfdecrypt ( link ) ed unzip it into the same extracted folder of the ipsw.
Open Terminal and navigate into the ipsw extraxted folder (tip: type cd then drag-and-drop directly the folder into the Terminal window)
Run the command:
./vfdecrypt -i 038-3763-001.dmg -o decrypted.dmg -k a31ffd506c6711c5a0c52c9f0a2f7208a2f63ad9dd40506e70d80ea20a981eb1312bc774
NOTE:
-i 038-3763-001.dmg
Is relative to the biggest .dmg in all the ones you can find into the extracted ipsw folder (referred to the Root File System)
-o decrypted.dmg
Is relative to the name of the output decrypted file, I called "decrypted" (the extension .dmg is fixed)
-k a31ffd506c6711c5a0c52c9f0a2f7208a2f63ad9dd40506e70d80ea20a981eb1312bc774
Is relative to the VFDecrypt Key exactly for iPhone 4S iOS 5.0.1 and 038-3763-001.dmg image. Source is theiPhoneWiki
Wait until the process terminates (You'll see a new prompt line)
Open (mount) decrypted.dmg (double-click it) and here it is the iPhone 4S root file system.
Navigate into the folder
/System/Library/Caches/com.apple.dyld
Make a copy of the (only) file dyld_shared_cache_armv7 (i.e. on your desktop) and rename it to dyld_shared_cache_armv7.new
Copy it (I used DiskAid) into your iDevice file system at the path
/var/spire
Navigate into that path (I used iFile Cydia App directly on my iPhone) and rename the original dyld_shared_cache_armv7 in dyld_shared_cache_armv7.bak. Rename now the recently copied dyld_shared_cache_armv7.new in dyld_shared_cache_armv7. Check that the new dyld_shared_cache_armv7 has the same properties than the dyld_shared_cache_armv7.bak (I had to add the execute property to the new file), than delete dyld_shared_cache_armv7.bak (I suggest also to backup that file before deleting it in case of problems).
Save, exit iFile, unplug from your Mac and reboot your device.
Reopen XCode and plug your device in. It probably won't be automatically detected. In this case open the Organizer (Window -> Organizer) and delete the current iPhone (or iPod touch, or iPad) profile (mine one had the the yellow light instead of the green one near the name), unplug it, reboot Xcode, reopen Organizer and wait your device profile auto installation process.
NOW your device should be fully working debugging your Apps! My iPhone 4 GSM iOS 5.0.1 JB with Spire installed does.
Hope this guide will help whoever have the same problem.
Thanks again kexik for his suggestions!
Find an ipsw for which there is the decryption key. Then uzip that ipsw and search iphone wiki for that particular firmware - there you will find a key as well as the name of .dmg file with root filesystem. Extract that dmg (using vfdecrypt or dmg decryptor) in extracted filesystem look for /System/Library/Caches/dyld.../dyld_shared_cache and copy that file to the place on the device I mentioned.
Sorry for not giving exact instructions, I wrote it from my memory. If needed, let me know and I will prepare more exact step-by-step. ;)

How to install a Ad Hoc provisioning app on windows itunes?

I drag the .mobileprovision and app.zip file in the list of applications in itunes, I also get add-cursor, but if release the mouse-button nothing happens. the list is still empty, whats wrong?
The only way I know to do this is to get the .app file in Mac, put it into a folder called "Payload". Then you have to ZIP this folder and change its name from "Payload.zip" to "MyAppName.ipa". Mac will ask if you are sure you want to change the extention, select "YES". Now you can drag and drop this file into itunes.
There's no other way to do it afaik. Windows makes problems with the macosx "fork" files (if you open the .app file there is a folder named "_MACOSX" or similar... and windows breaks this).
Unzip the app.zip. You will get a folder, e.g. MyApp.app. Now drag that folder into iTunes and it should be ok.
As mentioned - unzip it, but don't forget to drag the .mobileprovision too
If that doesn't work, check back in your provisioning so it's set to the right device.
Common mistake.
http://www.markj.net/iphone-ad-hoc-distribution-windows-mac/
You can save all this trouble though, but making a zip archive in the first place that doesn’t have the Mac resource fork. BetterZip is a handy Mac app that will do this for you. That preferences setting ‘Remove Mac specific stuff from archives’ keeps __MACOSX out of the zip, and the resulting zip will install on Mac and Windows. Another way to do this is to unzip in windows yourself, find the correct app folder, and re-zip.
Ive had this problem before. I'm pretty sure there can be no white spaces in the name as well... double check that before you try to add it.

update iphone app "CodeResources file must be a symbolic link"

I tried to update an iphone app, which lies in an other "itunes connect" profile. I used "application loader" and everything is fine until I try to upload the zip file
I get this strange message and cant figure out whats going wrong
"The CodeResources file must be a symbolic link to _CodeSignature/CodeResources"
I opened the bundle and the folder _CodeSignature is there.
I compiled the app with my distribution profile (no problems)
How are you zipping it? I'm betting that FooApp.app/CodeResources is a file, not a symlink.
If you're using command-line "zip", you need to use zip -y -r to preserve the symlink.
Had the same issue with XCode 3.2.5 (new submission interface), and all it took was to:
delete the build folder
clean, and then
build and archive again.
I had the same issue. But then I noticed that I was building in release mode to the simulator, and not a device. When I targeted a device, I got the proper application file, which I then zipped with the iTunes Artwork and submitted without issue.
I had the same issue here but I "fixed" it after I changed the "Deployment Target" from 2.0 to 3.0 in the target I was building and removed the "Architectures" to only armv6 (before I had both armv6 and armv7). Finally I had to put 'No' to 'Build Active Architecture Only'.
I haven't figured out why I keep getting this error for every binary I create. I've followed all the standard procedures (double-checking my project settings, deleting build folders, cleaning all targets, removing and reinstalling certificates and provisioning profiles, creating and installing new certificates and provisioning profiles, repairing disk permissions, etc) but none of them seem to solve the problem.
I think the problem is that my XCode installation is unable to create symbolic links. I might reinstall it (or even OS X) to see if that fixes the issue permanently.
But in the mean time, this works for me. I use terminal to navigate into the binary and run the following commands
rm CodeResources
ln -s _CodeSignature/CodeResources CodeResources
This deletes the invalid CodeResources file and replaces it with the required symbolic link to _CodeSignature/CodeResources.
I just ran across this issue. It turned out, I had two info.plist files in my resources folder (one for the iPhone version and another for the iPad version). Once I took care of that, the issue went away.
Try this on the command line:
cd (to where your project is)
ln -s _CodeSignature/CodeResources CodeResources
I've just had the same problem. Turns out the project file project.pbxproj in Project.xcodeproj had been corrupted while uploading to an SVN server.
My solution was simply to revert to an older revision, which worked fine.
You have to:
1. Enter the AppName.app folder
2. Create a file named CodeResources
3. Open the file with a plain text editor
4. Type in _CodeSignature/CodeResources (The path where the actual CodeResources file is.)
{The app will now know where the CodeResources file is, and will have an account for all the files in the .app folder.}

App not installed...because its resources have been modified

One user cannot install my app because they continue to receive the error:
The application “myapp” was not installed on the iPhone “myPhone” because its resources have been modified
I've read the error occurs because of adding files after the app is built. I have not added any files. Last week, the user could install the ad hoc without issue. I've tried clean and rebuilt with no luck. As the developer, the ad hoc installs fine on my device from iTunes, even after deleting all profiles. Any ideas?
IF this is an adhoc distribution, I'd clean and re-build it, then give it to the user again, along with the provisioning profile : basically make sure they have a clean set of everything.
There is also a reported issue on Vista / Win7 where windows corrupts the Zip. It may be worthwhile distributing it as a ipa file rather than a zip
For me the issue was the .Double files being added to every directory on a shared network drive. We are primarily a Windows environment, and the Mac was saving .Double files on the drive, in every directory.
Literally, to fix the issue referenced above, I simply deleted the .Double files in every directory (of the app being copied to iTunes) and it fixed it.
Hope this helps someone!
This issue also occurs when the person trying to install the .app file has double clicked on the appname.app folder (its shown as a folder in windows environment). When they do it, a thumbnail file is created in the windows environment. This in turn means that the resources have been modified and hence the error. We have always instructed our clients not to double click on the .app folder when they extract it from the zip file.

Problem installing ad-hoc app on iphone: "resources have been modified."

I can install an app on my development iPhone compiled with "Debug" configuration using my Ad Hoc provisioning and everything works OK.
But when I build it using "Release" configuration, iTunes says:
The application XXX was not installed on the iPhone "YYYY" because its resources have been modified.
I've never seen this message before. Does anybody know what it means?
Thanks!
Antonio
We had the same problem during our first Beta. Someone on Windows dug in the xxx.app folder then Explorer created a Thumbs.db file inside and, boom, he got the message "The application XXX was not installed on the iPhone "YYYY" because its resources have been modified." when he tried to install.
He had to remove the app from iTunes, deleted all the Thumbs.db from xxx.app and then it worked.
We finally got rid of the problem. We were trying to include an image for iTunes after creating the build, but when we used this method (http://iosdevelopertips.com/xcode/itunes-icon-for-ad-hoc-distributions.html) everything went smoothly.
Just in case it helps someone: In my case, I copied the .app to a network drive, then to my Win7 computer before dragging into iTunes - then it did not work. When I zipped the .app first before copying, and then unzipped it on the other end - it worked. Of course, I have no real idea why....
Your debug configuration and your release configuration have some important differences, and release is a lot closer to what ad-hoc should look like. So you first need to duplicate the release configuration and make and call your copy "Ad-Hoc", and make sure you use your ad-hoc provisioning profile with it. Then you need to create a new entitlements file. The new version of Xcode has a cool feature where you can build and archive your app into an ipa file that includes your provisioning profile.
How to do all of this is explained here: http://www.tuaw.com/2010/05/23/devsugar-a-better-way-to-share-ad-hoc-builds/
In those instructions, when it tells you to make the entitlements plist file, it says to uncheck get-task-allow in the plist file. When I created the entitlements file, there wasn't a get-task-allow row at all, so I created one, set the type to boolean, and left it unchecked. It worked great for me.
The best solution to avoid wierdness like this is to create an IPA file. A good step-by-step guide to creating an IPA target in XCode is here:
http://idotcomllc.wordpress.com/2009/05/26/how-to-build-a-ipa-file-from-xcode/
It starts out with an introductory project so search for "Aggregate" to find the point where it starts telling you how to create a new IPA target for build.
I directly upload the app to a server where the windows can also visit. Then compress it in Windows.
I had it, did a clean build and never saw it again.
Incomplete ipa/zip archives (received at the installation end) were the cause for us.
I had this problem using a run script to cp -R the .app file to the Payload folder, for some reason when the script copied the file it modified it somehow, if I used finder and manually copied the .app file into the payload folder and manually zipped the .ipa file it worked fine. I tested it several times using codesign -v to verify the .app file. it always through the error after a build and the run script. but no error when I would copy the file manually.
For me the issue was the .Double files being added to every directory on a shared network drive. We are primarily a Windows environment, and the Mac was saving .Double file on the drive, in every directory.
Literally, to fix the issue referenced above, I simply deleted the .Double files in every directory (of the app being copied to iTunes) and it fixed it.
Hope this helps someone!
I was tasked to test some apps and for some reason was the only one on my team getting this this error. I am working on an XP. All the apps we are testing use the same provisioning file yet some would sync while others would not. Not sure what fixed it but I did go into my *My Music\iTunes\iTunes Media\Mobile Applications* folder, deleted the existing .ipa file for the app I was trying to sync and it seemed to sync fine after. It might not be the answer to your problem but give it a try.
If you work with asstes on a Mac, or have versioned content, I had the same problem with .DS_Store files and hidden .git folders. Once deleted from assets, problem gone. It might be an issue with hidden files.