Xcode says I have 4.2 installed, but only 4.1 opens - xcode

I'm confused about this. When I go on the market or try to download 4.2 to get ios5 it says that it is Installed. I check my Xcode in the about section and it says it is running 4.1. I tried this Install Xcode that is in my applications folder assuming maybe it was for the update and it still shows 4.1. How do I update my xcode?

In your Applications folder, there is an app called Install Xcode. Run that to actually install Xcode4.2 after the App Store finishes downloading the upgrade. Weird, unexpected process, I know.

I had the same problem. After reading the answers here I looked for the "Install Xcode.app" file in the /Application directory and it wasn't there. It turns out that I had moved the "Install Xcode.app" bundle out of /Applications after I installed Xcode 4.1 (I didn't think it would be used again). I used Spotlight to remind me where I had moved it to and I ran it again and it updated the files. Now Xcode reports it is at version 4.2 like I expected. This is not at all like any other Apple installs. I wonder why they did it this way.

The App Store doesn't upgrade Xcode 4.1 to Xcode 4.2 for you like it does for all other apps. Instead, it just downloads an installer/upgrader which gets placed in your Applications folder, and proceeds to not tell you anything about it, hoping you can read its mind. To upgrade, you have to do this:
Download the update via App Store.
Manually upgrade by running: /Applications/Install Xcode
Another way to do an upgrade will be to manually remove Xcode 4.x first:
Delete Xcode: $ sudo rm -r /Developer (takes about 20 minutes to finish)
Delete any "Install Xcode" files from your Applications folder.
Download Xcode 4.2 from the App Store.
When finished, install it: Applications ---> Install Xcode
Re-download all Xcode Documents and Components: Xcode ---> Preferences ---> Downloads
That's the most extreme way of doing things. If you added anything to your /Developer folder, you should back it up before running the rm -r command, as that will delete EVERYTHING in it.
Your Xcode preferences will remain in-tact, as they're stored in ~/Library/Application Support/Xcode/ and ~/Library/Preferences/com.apple.dt.Xcode......plist

follow the instructions given in http://simplecodebits.blogspot.com/2011/10/update-to-xcode-42-in-mac-osx-lion.html

Related

MobileDevice.pkg untrusted, cannot open Xcode after OS X update

After an automatic update of macOS v10.15 (Catalina), I am unable to open Xcode. Xcode prompts me to install additional components but the installation fails because of MobileDevice.pkg (Applications/Xcode.app/Contents/Resources/Packages)
I have found multiple answers on how to locate MobileDevice.pkg and that I should try to install it directly, but when I try to do this the installation fails too. I have also tried updating Xcode from App Store, but the update failed when it was nearly finished.
Has anyone experienced the same behaviour? Should I reset the Mac to default and install macOS v10.13 (High Sierra) or Catalina from scratch or it is a problem of Xcode and re-install would do the job?
I have found a discussion here that was posted today and is probably regarding the same issue and it seems like many people are dealing with it, too.
The log:
*2019-10-25 01:03:34+02 Vendula-MacBook-Pro Xcode[1567]: Package: PKLeopardPackage
<id=com.apple.pkg.MobileDevice, version=4.0.0.0.1.1567124787, url=file:///Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg>
Failed to verify with error: Error Domain=PKInstallErrorDomain Code=102
"The package “MobileDevice.pkg” is untrusted."
UserInfo={
NSLocalizedDescription=The package “MobileDevice.pkg” is untrusted.,
NSURL=MobileDevice.pkg -- file:///Applications/Xcode.app/Contents/Resources/Packages/,
PKInstallPackageIdentifier=com.apple.pkg.MobileDevice,
NSUnderlyingError=0x7fabf6626d00
{
Error Domain=NSOSStatusErrorDomain
Code=-2147409654 "CSSMERR_TP_CERT_EXPIRED"
UserInfo={
SecTrustResult=5,
PKTrustLevel=PKTrustLevelExpiredCertificate,
NSLocalizedFailureReason=CSSMERR_TP_CERT_EXPIRED
}
}
}*
Edit and set the date of your Mac as October 1st, 2019.
I didn't have Xcode 11.1 installed and even though I could open and run the 11.0 after the below workaround I could not update to 11.1 as the update always failed. So I have just re-installed the whole app from the App-Store - you could probably also do this instead of the below method.
I have tried setting my system time to 1st October 2019 when the certificate should had been still valid. After that I tried to open Xcode and followed the component install which went well and now I am able to work with Xcode again.
I had a similar problem, where I installed Xcode 11.1, and installed the components and everything within the same folder where I had Xcode 10.2.1. Then, I tried to go back to Xcode 10.2.1 and couldn't opened as it was asking me to install components again, and when I tried I was getting this error.
The package “MobileDeviceDevelopment.pkg” is untrusted.
So, the workaround that fixed it for me was navigating to...
/Users/YourUser/Applications/Xcode\ 10.2.1.app/Contents/Resources/
Then, deleting MobileDeviceDevelopment.pkg and everything went back to normal :)
I hope this helps anyone else with this issue. Cheers!
At macOS Catalina
cd /Applications/Xcode.app/Contents/Resources/Packages
sudo rm -rf MobileDevice.pkg
sudo rm -rf MobileDeviceDevelopment.pkg
Try again.
It means you entered on the Xcode downloaded packages and remove it. I really don't understand how Apple do but if you remove Xcode will download it again and revalidates.
Some remarks, I'm on XCODE Version 11.0 (11A420a) if you are not this is not guaranteed to work.
You may solve this issue by setting the date of your Mac as October 1st, 2019. But this is just a hack! The real solution (suggested by apple) is this:
All you have to is to upgrade Xcode
But there is a known Issues on apple developers site
Xcode may fail to update from the Mac App Store after updating to macOS Catalina. (56061273)
Apple suggests this:
To trigger a new download you can delete the existing Xcode.app or temporarily change the file extension so it is no longer visible to the App Store.
Always working solution for all Xcode issues:
Go here and log in.
Then download the xib from here.
More information here on this answer.
##Answer to this specific issue##
Get rid of those packages.
cd /Applications/Xcode.app/Contents/Resources/Packages
sudo rm -rf MobileDevice.pkg
sudo rm -rf MobileDeviceDevelopment.pkg
Xcode will install all of them again for you.
rm -rf /Applications/Xcode.app/Contents/Resources/Packages/*.pkg
It will work and re-open the x-code
Try to run Xcode-beta instead of Xcode to install additional components. After that you'll be able to use Xcode release.
For me, I just uninstalled (deleted the app from the Applications folder) and then went back to app store and clicked the cloud icon and it downloaded fresh and installed. Now all is good and back to normal.
Here's what I did to resolve:
Right click the xcode.app > show package contents > Contents > Developer > Platforms > iPhoneOS.platform > Device Support
I am on XCode 10.2.1. I had downloaded a 13.7 folder and contents from an external GitHub site and imported that folder into here for running my app on a physical iPhone Xr. I am prevented from upgrading to Catalina on my dev machine. Deleting the 13.7 folder and then re-launching XCode resolved the issue for me.
Reinstall Xcode 11.1 from https://developer.apple.com/download/more/ . Afterwards the update works.
This requires Xcode 11.1 to be installed.
I was not able to update to Xcode 11.1 until I updated macOS Catalina to 10.15.1. After updating my macOS, I was able to install Xcode 11.1, which also allowed the installation of the additional components package.

Going back to XCode 4.1 after installing XCode 4.2 beta 7

I've installed XCode 4.2 beta but I realize I can't deploy applications on my iOS 3.1.3 device. The previous XCode 4.1 was able to, but it seems I can't install it back.
What I've tried so far:
install XCode 4.1 directly on top of 4.2. XCode 4.2 persisted
delete the Developer folder, install XCode 4.1. Nothing happened, altho the installation went thru
What am I missing ?
I had the same problem and had to run this in Terminal:
sudo /Library/uninstall-devtools --mode=all
This will remove your Development folder and the other bits around your system, so that you can install Xcode from scratch.
I just went through this. "Installing" XCode 4.1 on top of the 4.2 beta doesn't actually do anything other than creating a 4GB "Install Xcode" file in /Applications. Running THAT shows a prompt that the newer version of XCode will be moved to /Developer-4.2 and the old version will be installed in /Developer.
I found the process confusing because I didn't realize right away that I was supposed to run /Applications/Install Xcode.
try to install it in the other directory ie. Developer/Xcode_old/ but then you have to run proper application(from the correct path).
I have currently both versions installed, so that's definitely can be done.
The problem I had was that I downloaded the 4.1 installer from Apple, but the 4.1 installer doesn't actually install XCode 4.1, it installs an installer for XCode 4.1 called "Install XCode"--BUT "Install XCode" already existed for the 4.2 install and it would not apparently overwrite it.
I renamed "Install XCode" to "Install XCode 4.2", reran the XCode 4.1 "installer" which installed a new "Install XCode", this time for 4.1.
(Who came up with this installer for an installer madness?)
I'm just ran the installer for XCode 4.1 (after mv'ing /Developer to /XCode-4.2) and it seems to have worked.

Xcode 4.1 can't reinstall. App store says "installed"

Today i update my system to Lion and try to update Xcode.
After downloading from app store i get error.
So i remove my old Xcode 4.0 by this command
/Developer/Library/uninstall-devtools –mode=all
But now in app store i have the status "installed" and can't reinstall my Xcode.
So what i must do?
p.s Trash is clear.
When I downloaded Xcode from the Mac App Store it created an Icon in launchpad called 'Install Xcode' and you're able to kick off the install from there.
My installation failed the first time and I was able to reinstall fine.
sudo /Developer/Library/uninstall-devtools –mode=all
sudo rm -rf /Developer*
sudo rm -rf /Applications/*Xcode.app
Download & Install "Install Xcode.app" or now just "Xcode.app" from the AppStore again, and run it.
Try a spotlight search for Xcode. I found an Xcode installer app in my applications folder when I did that.
Delete "Applications/Install Xcode" you can then re-install from app store
I had the same problem with other app. Deleted it and could not install again from App Store. The problem was that I had backup copy on the mounted external disk. After I have un mounted the disk with the other copy, App Store let me download the app again. Regarding to what verylastminute wrote - if Appstore can "see" any other duplication file it will not let you re-download.
open terminal window
cd /Applications
sudo rm -rf Install\ Xcode.app
After that you should be able to reinstall
I had a similar problem - clicking on Install in the Mac App Store did absolutely nothing. No error messages, no downloads, no install.
I had to all of the following to get the Xcode install to work:
rm ~/Library/Preferences/com.apple.appstore.plist
rm -r ~/Library/Saved\ Application\ State/com.apple.appstore.savedState
rm -r ~/Library/Caches/com.apple.appstore
rm -r /private/var/folders/*/*/*/com.apple.appstore
Then I deleted my existing '/Developer/Xcode.app', and an existing '/Applications/Install Xcode.app' from a previous version. Even then it didn't work until I restarted my machine!
If you have moved the Install XCode file anywhere else, and even if you have renamed it, Spotlight still shows it being in both the new location and in Applications. You need to delete any duplicates you may have made of the file before App Store will let you download it again.
I had a similar issue. I resolved it by creating another admin account on the computer. Then I installed Xcode using the new admin account.
You haven't installed Xcode, not yet. It's confusing, especially when trying to downgrade from Xcode 4.2 to Xcode 4.1 on Lion, but since the migration to App Store Xcode installs, you "install" the install app, which you then have to run to install xcode.
You've installed "/Applications/Install Xcode.app"
You need to run this to actually get "/Developer", gcc, make, etc
Simple solution : on App Store, instead of going in updates or in installed apps, simply go to "Bought apps" page. On this page, you have the option to update Xcode.
After I have tried all suggestions from this and other forums I finally managed to solve the problem in the following way: I went to the App Store menu Store -> View My Account and it was only there that I saw XCode as available with an "Install" button. Hope this helps.
In my case, on macOS 12.2 Monterey with M1 chip, there was no "Install Xcode" directory. I ran this instead and it worked:
rm -rf /Applications/Xcode.app

Uninstall Xcode 4 when it was installed via the App Store

I understand that those who installed Xcode 4 via the developer site are able to uninstall via /Developer/Library/uninstall-devtools –mode=all, however I installed via the App store and there doesn't seem to be an executable with the word "uninstall" in the name anywhere in the Developer folder at all. Any suggestions on how I should go about uninstalling Xcode 4?
This help for Xcode before MAS install
/Library/Developer/Shared/uninstall-devtools
If you install it from MAS you can remove from launchpad,
but also need to remove some folders** and files created by this app, you can use some helper application that found this files and safely remove it :)
** ex.: ~/Library/Developer, ~/Library/Application Support/Xcode, ~/Library/iPhone Simulator, Logs and etc.
From the above comment, the correct way is to:
Run sudo /Developer/Library/uninstall-devtools –mode=all
Delete "/Applications/Install Xcode" if you want the app store to allow you to reinstall it.
If you have installed xcode from Mac App store, then you need to delete it from Launch pad. You can do this by locating xcode icon in launch pad, long click on the icon till it starts dancing. Then delete it and wait for a while till the xcode.app is deleted from /Application. If you manually delete xcode.app from /Application, App store will continue to think its installed and will not allow you to reinstall in future.
In our installs of xCode 4 from the App Store, we are able to use:
sudo /Developer/Library/uninstall-developer-folder
You must uninstall first the
sudo /Library/Developer/Share/uninstall-devtools –mode=all
It might be something else in your particular case so maybe you can try
locate uninstall-devtools to find where the script is placed.
Then you can find the version you need of xcode from https://developer.apple.com/downloads/index.action
IMPORTANT: If you are going to install a previous version of the Developer Tools, be sure to restart the machine after installing.

Can I have multiple Xcode versions installed?

Is it possible to have more than one version of Xcode installed at the same time?
If so, please post any tip, tricks, or potential issues to watch out for.
EDIT:
The reason I want to install multiple versions is to try out the new sdk beta, but if the new Xcode is buggy I want to be able to use the older version for my existing projects.
Yes, you can install multiple versions of Xcode. They will install into separate directories. I've found that the best practice is to install the version that came with your Mac first and then install downloaded versions, but it probably doesn't make a big difference. See http://developer.apple.com/documentation/Xcode/Conceptual/XcodeCoexistence/Contents/Resources/en.lproj/Details/Details.html this Apple Developer Connection page for lots of details. <- Page does not exist anymore!
Can I have multiple Xcode versions installed?
Solution:
Actually as many of the above answers says, it is possible.
Even according to the following Oracle Mobile Platform Blog, you can install more than one XCodes in the same Mac. The reason why you need to do that may vary according to you.
Scenario:
You might have installed only one version of XCode for now. Mostly the one release behind the latest XCode version which is available through App Store (mine I've Xcode 6.3.2 and I needed to keep it and also install Xcode 7 which is available through App Store).
For Ex:-
You have already installed XCode 6.x, and App Store has XCode 7
already given by App Store. For any reason you need to keep that Older
XCode 6.x(as you know it is stable for some time now) and also you
need to install and try out new XCode 7
So number one question might be, How and Where could you download the Mac OS X installable DMG file for XCode 7 (or may be if you wanna try out an older XCode version)? Ok, here is the direct link apple downloads (you might have to log into Apple Developer account before viewing this link correctly), or else following is a StackOverflow Q&A link which gives the answer to where to download DMG files for XCode IDEs.
So now let's assume that you have obtained any of the DMG file for the XCode version you require to install as secondarily?
Steps:
Follow the steps given bellow which I got from the above given first link of Oracles Mobile Platform Blog.
Close Xcode if running
Rename /Applications/Xcode.app to /Applications/Xcode_6.x.app
Enter the admin password when prompted
Double click the DMG file of your required, pre-downloaded Xcode and install it
Once installed it, before running it, change the new
/Applications/Xcode.app that was just installed to (according to my above given example) /Application/Xcode_7.app
Note*:
[Please patiently read this section until the next Note] When you have two versions of Xcode installed, your workstation has two versions of Command Line Tool (xcodebuild) installed too. The question is what your Terminal and Xcode build command will use to when you are building your iOS App. Because along with the Command Line Tool, iOS SDK which is being used to build your app also depends on.
My experience was I've had two Xcode versions. Xcode 10 (Old one with iOS12.0 - iphoneos12.0), and Xcode 10.1 (New one with iOS 12.1 - iphoneos12.1). So obviously the settings for Command Line Tool was selected to use xcodebuild tool from the Old app. I had to manually select it in Xcode preference window.
Where to set Command Line Tool in Xcode Preference Window?
Select the Locations tab and there, you can select all the installed versions of Command Line Tools (which is xcodebuild).
How to figure out which version of iOS SDK is being used to build your iOS App?
On your Terminal issue following command:
$> xcodebuild -showsdks
Above command should print out all the SDK details which your current Xcode configuration uses to build your Apps. And by seeing the results you will understand that your iOS/iphoneos SDK version depends on changing Command Line Tool (xcodebuild) setting on your Xcode.
Note**:
Above given Apple Downloads link and Oracles MPF blog post links might change and/or unavailable in the future.
So I hope that my this answer might be helpful to somebody else out there!
Cheers!
It's easy to have multiple Xcode installs.
In the installer there's a pulldown for the location... you just need to pick a new location when you're installing the beta version.
These instructions from an Apple dev tools evangelist have the full details (Apple dev username/password required):
https://devforums.apple.com/message/40847#40847
Then grab yourself a custom icon for the Beta version of XCode you're using, so you can tell them apart in the dock:
http://iphonedevelopment.blogspot.com/2009/03/multiple-developer-tool-installs.html
You may want to use the "xcode-select" command in terminal to switch between the different Xcode version in the installed folders.
It seems that Xcode really likes to be in the Applications folder and be called Xcode, especially when using xcodebuild (when building for Carthage for example) - and xcode-select doesn't always seem to cut it.
I have a client project that's still using Swift 2.2, and I'm stuck on Xcode 7 for that and using Xcode 8 for anything else.
So, in my Applications folder, I have Xcode 7 (renamed to Xcode_7) and Xcode 8 (renamed to Xcode_8). Then I rename whichever one I need to simply Xcode, and back again when done. It's a ball-ache, but seems to work.
This shell script simplifies it a bit…
xcode-version.sh
cd /Applications
if [[ $1 = "-8" ]]
then
if [ -e Xcode_8.app ]
then
mv Xcode.app Xcode_7.app
mv Xcode_8.app Xcode.app
echo "Switched to Xcode 8"
else
echo "Already using Xcode 8"
fi
elif [[ $1 = "-7" ]]
then
if [ -e Xcode_7.app ]
then
mv Xcode.app Xcode_8.app
mv Xcode_7.app Xcode.app
echo "Switched to Xcode 7"
else
echo "Already using Xcode 7"
fi
else
echo "usage: xcode-version -7/8"
fi
xcode-select --switch Xcode.app
Note that if you use the xcodebuild command line tool, then the last version of Xcode installed will become the default version. (A symbolic link is installed in /usr/bin.) To use the xcodebuild for the other versions of Xcode you'll need to use the version in the (xcode_install_directory)/usr/bin directory.
note To switch between different versions of the Xcode command-line tools, use the xcode-select tool mentioned by other commenters.
Multiple Versions Of Xcode & Simulators using gem Xcode::Install
Install and update your Xcodes automatically.
You can greatly simplify this process by using the
Xcode::Install Ruby Gem.
You should already have a working installation of the
Xcode Command Line Tools and a version of Ruby that supports building native extensions.
I'd suggest using Homebrew for installing
rbenv and use rbenv to install Ruby.
A guide for this can be found here and many other places.
But it should work with the stock Ruby supplied by newer macOS versions as well, if you install the gem either using sudo (not recommended) or using --user-install when installing the gem.
Installation
Basically:
# Install the Ruby Gem (I'm using rbenv, so no sudo or --user-install)
$ gem install xcode-install
# To list available versions:
# PS!You will get prompted for your Apple Developer / iCloud credentials)
# It's using Apple's own API's so 2FA are supported if enabled
$ xcversion list
6.0.1
6.1
6.1.1
6.2 (installed)
6.3
# To update the list of available versions, run:
$ xcversion update
# To install a certain version, simply:
$ xcversion install 8
##################################################################### 100.0%
Please authenticate for Xcode installation...
Xcode 8
Build version 6D570
This should download and install and activate that version of Xcode.
You can start it from /Applications as usual.
The new version will also be automatically selected for CLI commands
To select a different version as active, you'll run:
xcversion select <version_number>
from the list of installed versions, marked as (installed) like:
# To see the active version in use:
$ xcversion selected
# To select and activate an installed version:
$ xcversion select 8
# To select, activate and change the symlink in /Apllications
$ xcversion select 8 --symlink
Other fun stuff, Simulators etc
Xcode::Install can also install Xcode's Command Line Tools by calling
xcversion install-cli-tools
and can also manage your local simulators using the simulators command.
But instead of repeating more information that is probably going to change over time, head over to the project's GitHub page
for more about this gem.
Staring with Xcode 9, the beta Xcode is labeled 'Xcode-beta.app' and is designed to live side by side with the production version. Info can be found in the Xcode release notes here. (Not using direct link because it breaks often).
From Apple:
Xcode 9 beta 4 can coexist with previous versions of Xcode. Prerelease
versions of Xcode are made available from developer.apple.com,
packaged in a compressed XIP file. To install Xcode during the beta
period, download the XIP file, double-click the file to expand it in
place, then drag Xcode-beta.app to the Applications folder
Download a version
The beta and stable releases can be taken from the Developer Software downloads Application tab, here), but older versions can be taken from here. Just extract the .xib and put Xcode-beta.app in your Applications folder.
Switch versions
Using the beta: sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
Using the original: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Check version changed
You can validate the version has changed by running xed --version, and it will output the correct version: e.g. xed version 12.5 or xed version 13.0
To have multiple Xcode instances installed you can put them to different folders for example /Developer5.0.2/Xcode, but to use them in CI or build environment(command line) you need to setup some environment variables during the build.
You can have more instructions here.
So it is working not just with beta and fresh release, also it's working for the really old versions, you might need it to use with Marmalade or Unity plugins which is not support the latest Xcode versions yet(some times it's happens).
Whatever advice path you go down, make a copy of your project folder, and rename the external most one to reflect what XCode version it is being opened in.
Your choice on whether you want it to update syntax or not, but the main reason for all this bovver is your storyboard will be altered just by looking. It may be resolved by the time a new reader coming across this in the future, or
All the updates for new version of xcode will be available in appstore if you have installed the version from appstore. If you just paste the downloaded version appstore will show install not update. Hence keep the stable version downloaded from appstore in your applications folder.
To try new beta releases i usually put it in separate drive and unzip and install it there. This will avoid confusion while working on stable version.
To avoid confusion you can keep only the stable version in your dock and open the beta version from spotlight(Command + Space). This will place beta temporarily on dock. But it will make sure you don't accidentally edit your client project in beta version.
Most Important:- Working on same project on two different xcode might create some unwanted results. Like there was a bug in interface builder that got introduced in certain version of xcode. Which broke the constraints. It got fixed again in the next one.
Keep track of release notes to know exactly what are additional features and what are known issues.
First, remove the current Xcode installation from your machine. You can probably skip this step but I wanted to start fresh. Plus — Xcode was behaving a little weird lately so this is a good opportunity to do that.
Install Xcode 8 from the App Store. Make sure project files (.xcodeproj) and workspace files (.xcworkspace) can be opened with the new Xcode installation (remember to select the Later option whenever prompted).
Download the Xcode 7.3.1 dmg file from Apple. Double-tap the newly downloaded dmg file in order to get the standard “Drag to install Xcode in your Applications folder”. Don’t do that. Instead, drag the Xcode icon to the desktop. Change the file name to Xcode 7.3.1. Now drag it to the Applications folder.
Now you have two versions of Xcode installed on your machine. Xcode 7.3.1 and Xcode 8.
Details: Install Xcode 7 & Xcode 8 side by side

Resources