As @patrix told me to tried on my own self, I've do so, I got the simulator from here,
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
and copy the simulator sdk you want to add in your xcode, and paste it on the same path as above in your mac. That's it.
It's likely that filename.zip
is either not actually a .zip
file, or is corrupted.
Open up Terminal. You can access it by typing "Terminal" into Spotlight.
Enter the command(s) in the steps below into your command line prompt (triple click the line, copy it, and paste it into your prompt). Replace filename.zip
with the actual name of the zip
file.
If the name of the file contains spaces, you need to enter it differently using the escape \
character. For example, if the file is named compressed crap.zip
, you'd type compressed\ crap.zip
in the command line.
Step 1:
Repair disk permissions. Once done, attempt to open the .zip file again. If you wish, you can do this from the command line.
diskutil repairPermissions /
Step 2:
Use file to confirm it's actually a zip file:
file ~/Downloads/filename.zip
The output should be:
Zip archive data, at least v2.0 to extract
If you don't receive this output, post the output as a comment before proceeding.
Step 3:
After confirming it's actually a zip file, attempt to unzip it directly from the command line:
unzip ~/Downloads/filename.zip -d ~/Downloads
Step 4:
Step 3 will likely fail. Run the zip command to attempt to repair any corruption and salvage the contents of the archive (again, replace filename.zip
with actualname.zip
):
zip -FF ~/Downloads/filename.zip --out ~/Downloads/Repairedversion.zip
If it executes cleanly, you'll be directly returned to your prompt. Quit Terminal. Navigate to your Downloads folder and double click Repairedversion.zip
- it should unzip without issue.
Alternatively, it may not exit cleanly. If you're presented with
Is this a single-disk archive? (y/n):
Hit the y
key. After you're returned to the prompt, again attempt to open Repairedversion.zip
from your Downloads folder. If you're still unable to open it, comment below with the warning(s) received from the command. If you've reached this point though, it's likely that the file is irreparably damaged.
Best Answer
Xcode is an easy reinstall. Have you tried deleting it and going back to the Mac App Store to reinstall it?
If you’re developing on a beta version, be sure to list that in the body and you can do the same re-download and reinstall.
If you’re comfortable with the command line:
Check that your path is correct, and perhaps reset the tools path (which
swift-auth
) and call for the command line tools to be installed if needed:The above commands will be substantially faster and more surgical to reinstall, but if you are missing one Xcode tool, you might need the whole app again depending on what caused the error in the first place.