How to change Xcode Install destination? (When installing iOS 4.x beta for example) - iphone

I am working on a project using iOS3.2 SDK and also want to test my app in iOS4.2 beta.
So I installed Xcode and 4.2 SDK but it replaces previous Xcode installation. Up until now it was ok since I was not busy with these two things. But now I need both.
How Do I change Xcode (with iOS SDK 4.2) install destination?
I was expecting a button "change install destination" during install but only installation disk partition is changeable. (No folder can be chosen).
Is this possible?

Yes, you missed it in the installer because they made it hard to find. Once you pick the volume (your hard drive), you can Customize the installation, which lets you specify a location (/Developer-Beta or whatever you want). Unfortunately, you'll now have to reinstall other one again.

Related

Jailbreak development using xcode

I have been looking around for learning how xcode can be used for jailbreak development.
I have Lion and jailbroken iPhone3G and xcode4.6 which doesnt support iPhone3G.
I have installed ldid but have no idea how to use it.
I have to make launch daemons, too, and attach them with my application. I have followed this tutorial for making a daemon but i got stuck in the setup for creating an open tool chain template in xcode. I followed every step but my xcode is not showing any template for open tool chain. Is it really required to have open tool chain template?
You're right. Xcode 4.6 doesn't support the iPhone 3G. Can you install an older version of Xcode? For example, Xcode 4.4 still supports the 3G.
Login to the Apple Developer Portal and download old versions here
You can choose to install the old version of Xcode in a different folder, so that it doesn't overwrite the new version (for example, install to /Developer-old/ or something).
Once you install the old Xcode version, you can navigate to the installation directory and look for the directory named:
iPhoneOS5.0.sdk
(or probably iPhoneOS5.1.sdk would work, too). Then, copy that entire folder into the new Xcode 4.6 installation directory. For example:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Afterwards, you should see this:
iPhoneOS5.0.sdk
iPhoneOS6.1.sdk
With the 5.0 SDK installed, you can now build apps for the iPhone 3G, using Xcode 4.6. You can also now uninstall Xcode 4.4 if you want. See more about this in this other question. The key is that you will be building your app for armv6 (only). Armv6 is the iPhone 3G's processor.
The second step is to turn off code-signing within Xcode. In your project settings, you set the provisioning profile to Don't Code Sign. You must modify an Xcode configuration file to allow you to do this.
Now you build the app in Xcode. When you're done, navigate to the directory on your Mac where the app has been built (where the MyAppName.app/ folder is). Then, you use ldid to fake code sign the app executable:
ldid -S MyAppName.app/MyAppName
Now, your app has a fake code signature that will allow it to run on a jailbroken phone.
Then, you use ssh, or scp, or something else to transfer it to your phone, where it should be installed under /Applications/.
You already have the best link on building iOS Launch Daemons. I'd stick with that tutorial. No, I don't have any open toolchain template in Xcode, either. I just use Chris' tutorial to see how to build a non-graphical daemon main program (not a UIApplication), copy it to my MyAppName.app folder, and create a com.mycompany.mydaemon.plist file that defines the Launch Daemon.
Once the plist is installed in /System/Library/LaunchDaemons/ on the phone, you can start it, without having to reboot the phone, with:
launchctl load -w /System/Library/LaunchDaemons/com.mycompany.mydaemon.plist
at the command line (on the phone). Or, just reboot the phone, and the daemon will start automatically.
Although I learned to do this before it was available, you can now look at iOSOpenDev if you'd like a more polished way of doing some of this stuff.
Yes. Xcode can be used for developing jailbreak-type projects. Use iOSOpenDev to set up Xcode and iOS SDK to allow jailbreak-type development.
iOSOpenDev comes with a set of templates, signs (with ldid) targets and creates Debian packages (packages are submitted to repos like ModMyI and BigBoss) during its build phase, in addition to installing packages directly to an iDevice with Cmd-Shift-I (build for profiling shortcut) for immediate testing, among other useful features for using Xcode to develop jailbreak-type projects.

iOS simulator only list the latest iOS version. How can I set earlier versions

According to the documentation should be able to choose which iOS version the simulator should run, however only the latest 4.3.2 is listed under "Hardware/Version".
The helps says:
"To set the iOS release used in the simulation environment, choose Hardware > Version, and choose the version you want to test on."
I don't want to support 3.x (although it would be nice) but at least I want to simulate my app on 4.2, 4.1 and 4.0.
What's going on? Why aren't they listed?
UPDATE:
I'm on Lion so I cannot install an earlier version of Xcode. Before my Upgrade I could test different versions easily.
the problem is that you have no other Simulator SDK installed which can be used. As #dorada has mentioned you have to install an older Xcode which in fact doesn't work because you're using Lion. I haven't tried it with Lion but principally it should work like before with Snow Leopard.
I'm referencing to my other answer how to get an older Xcode (don't know if it's still working)
After you have an older Xcode version, mount the image an navigate with terminal to that volume. There should be a hidden folder Packages. open that folder with open . and locate the two .pkg files you need (e.g. iPhoneSDK4_0.pkg and iPhoneSimulatorSDK4_0.pkg) and install both.
They will appear in your root directory and you have to move them to your Developer dir (don't simply overwrite, it will delete all other SDKs. go to the last different folder it should be iPhoneSimulator4.0.sdk\ and copy that one)
DONE (and at that point I have verified it: it works on my Lion. I used the dvd image which I have started backup'ing since 3.2.1)
Although iPortable has the correct answer I decided to post a step-by-step guide which is easer to follow:
Download Xcode 3.1
Mount the dmg file
In Finder menu select "Go\Go to folder" and enter "/Volumes/Xcode and iOS SDK/Packages"
Install the simulators you need (Double click)
Copy the simulation folders from /Platforms/iPhoneSimulator.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
If your have some SDK missing Install the missing SDK from "/Volumes/Xcode and iOS SDK/Packages" and copy subfolders from /Platforms/iPhoneOS.platform/DeviceSupport/ to /Developer/Platforms/iPhoneOS.platform/DeviceSupport/ (for me they were all there from 3.1 to 4.3)
you may download the older ios sdk / xcode from . https://developer.apple.com/downloads/index.action
(i found this answer in another stack overflow topic actually, but now i can not seem to find that question!)
Open Xcode and in the menu at the top left, where you select what device to run on, click "More Simulators..."
The download section of Xcode preferences will open,
Click the "Components" tab.
You will see a list of simulators that can be installed, click install on version you need.
The simulator will need to restart to install.
To run the newly installed version of the simulator just select it from the run menu in Xcode.
You actually have to install previous simulator versions, they aren't there on a new install.
Maybe you can search and download them somewhere? - we keep them on a shared drive at the office.
After installing the Xcode 4.2 for Snow Leopard, I noticed there was a choice for iPad 3.2 Simulator, but using it just brings up some alerts that say "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." and another alert that says "Simulated application quit. Click Relaunch to try again." with Quit, Switch SDK, and Relaunch buttons.
I can successfully use iPhone 4.0 Simulator, iPhone 4.1 Simulator, iPad 4.2 Simulator, etc up to iPad/iPhone 5.0 Simulator, but really would like to have iPad 3.2 Simulator and iPhone 3.1.3 Simulator and earlier down to 3.0 if possible.
Our apps generally run all the way back to 3.0 and we occasionally receive bug reports from earlier iOS users, and would love to be able to debug these issues more effectively.
I tried the technique summarized by Tibidabo and although I am able to copy the simulator folders as mentioned, and though they show up as choices in Xcode, I cannot get them to actually run as simulators and I get the same problem alerts mentioned above.
What are other developers doing to support debugging of older iOS versions?
Go to Project Settings -> Summary an change Deployment Target.

Installing XCode 3.2.6 but no Xcode app in the Applications folder

I just installed Xcode 3.2.6 a couple times in a custom directory. I am installing that in addition to Xcode 4.2 that is installed in my developer folder. I can't seem to find the Xcode app in the Applications folder in the custom directory. All I see is a Utilities folder. Any ideas as to what might have happened?
Couple things to keep in mind:
If you are going to have multiple versions of Xcode installed, you MUST install them in order from lowest to highest version number, or you will break ALL of them. For example, if you installed Xcode4 and then Xcode3, neither is likely to work. The reason for this is that part of the Xcode install includes stuff that can only be placed in shared directories -- directories shared by all instances of Xcode. Installing an older version of these files over a newer version breaks 'em all. (I just went through this pain, by accident!)
If you install into a custom directory, the Xcode binary WILL be in the Applications folder in that custom directory. The default directory that Xcode installs to (if you don't change it) is /Developer, of course, but you can change this when you are doing an install to say, /Xcode4 or whatever you like. That being said, Spotlight Search is certainly a good first step to locating stuff you just cannot find by hand. :-)
I ran into the very same problem.
uninstalled version 3.2.6 using the uninstall --all method via terminal (described in documentation).
then re-installed 4.2 version, then uninstalled, using terminal,
then re-installed 3.2.6 |===> now running smoothly.
might see what happens if i add 4.2 in a different directory later.
Just use search function in finder dude.
Anyway, default location for Xcode installation is under Macindosh HD\Developer\Applications
If you didn't change the path during installation, you should be able to find it there

Switch between Xcode 4.0.2 and 4.2

I am developing an app with Xcode 4.0.2 and iOS 4.3. Now I would like to upgrade to Xcode 4.2 and iOS 5 so that I could make my app ready when iOS 5 releases in October.
I am told by Apple's website that I should not submit apps that are built by Xcode 4.2 and should do it with the older Xcode 4.0.2, since the Xcode 4.2 and iOS 5 thing is still in beta.
But in the following few weeks I still need to have newer versions of my app submitted to App Store. So my question is,
If I upgrade my Xcode to 4.2, is it possible for me to switch back to Xcode 4.0.2?
If yes, how?
Thanks in advance!
You can simply install two versions of Xcode at the same time. During the installation it will let you choose the destination folder; you can pick another folder. For example, I use /Developer/Xcode (4.2). (However, if you did install 4.2 over 4.0.2, I don't think you would have a problem if you just ran the 4.0.2 installer again to downgrade.)
Taken from About Xcode.pdf (<Xcode>/About\ Xcode.pdf)
Installation
The Xcode installer will create the folder /Developer on the root of your boot partition, and place the Xcode developer tools and SDKs in this folder. If you have a previous version of Xcode you would like to preserve, you can copy the existing installation from /Developer to another folder to prevent having it updated automatically by the installer.
I would be cautious of this note (possible problems from incompatibility of tools???)
NOTE: The Xcode installer also installs system components and UNIX command line tools in a shared location on your Mac. Only one version of these components can exist on a computer at a time, and the last installed version replaces any previously installed set.
I always make sure I have a bootable drive with a decent working copy of xcode ready for releases in case I need to push a quick fix.
You can install 2 XCode in different folders.
Then you can switch back and forth.
Can I have multiple Xcode versions installed?

iPhone: There is no SDK with the name or path 'iphoneos3.0'

A friend of mine just had to reinstall his OS (after power went down while updating) and when he installed Xcode he got this error. In the drop down that usually has device/simulator etc, it said 'missing'. I also noticed he had no developer folder on his machine as well. Anyone know why this might be?
Tell me about it. Try this
in XCode goto 'Project' Menu and select 'Edit Project Settings'. In the General tab, last but one item, select the drop down list 'Base SDK for all Configuration' There you can specify which SDK your project will target.
I had this problem after installing the Xcode that comes with Snow Leopard. To solve it I downloaded Xcode for iPhone. The Xcode that comes with Snow Leopard does not include the iPhone SDK.You have to be a registered iPhone developed to use it.
I had him reinstall it with me there, and I noticed that the action for the developer tools, was install as opposed to upgrade, and it was grayed out so not sure how he would have been able to avoid that. In any event he reinstalled and got the same error when launching from the dock. He then launched from terminal and it worked fine... so somehow he got two installs or some weird scenario. In any event we found the .app that spotlight saw and put it on the dock and then it worked.
The system does not include the dev tools (and hence the /Developer folder) by default. He needs to re-install the dev-tools from his CD (or from developer.apple.com), and also re-install the iPhone SDK (only available on developer.apple.com).
EDIT: I didn't see he re-installed XCode. Sounds weird. Make sure you re-install everything, and that you have the correct rights. However, is no issue is found by the installer and you still don't have a /Developer directoty, there might be something weird going on...
After Xcode updated to Version 11.6 got this error.
error: There is no SDK with the name or path '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk'
Looks like iPhoneSimulator13.5.sdk got removed.
Fix by downloading "iOS 13.5 Simulator"
In Xcode -> Preferences -> Components downloaded iOS 13.5 Simulator again.