Steps to test iphone app on device (profile/certificate already created) - iphone

I want to test my app on my itouch which has ios 4.2.1 .
I have completed the steps for provisioning profile/certificate. So under Organizer,
when I select my device, I am seeing the provisioning profile
and under Developer profile, I see 2 entries; iPhone Developer and iPhone Distributor
Now I want to just test the app on my device (NOT looking for steps to submit the app for distribution at this stage)
I think there are some Project settings that I need to do under XCode. But I am unable to figure it out. Please provide me the steps to test on device.
My XCode ver is 3.2.5

I was hitting an issue following this and the documentation where my app would not deploy to my iPhone 3G running iOS 4.2.1 using XCode 4.2. I hope this helps others who end up on this question trying to get their apps to deploy to a real device through XCode.
I kept fiddling with the Base SDK setting along with the Deployment Target setting in the project and target settings area. However, I had them correct to start with so that wasn't the answer (I want to target iOS 3.2+, so I kept all set to that). In addition, I messed with the provisioning profiles, certificates, etc. multiple times even though they looked right to me. They weren't the issue, either.
The key was changing the architecture settings that are scattered throughout the interface.
First, since I am testing it on an iPhone 3G, I needed to support the armv6 architecture as well as armv7 for later models. So I added "armv6" to the "Valid Architectures" entry on the project's "Build Settings" tab.
Next, I made sure it was showing "armv6 armv7" under "Architectures" in the "Build Settings" tab of the target for my project.
Finally, I clicked on the -Info.plist file for my project and removed the "armv7" entry for the "Required device capabilities" that is put there by default for new projects in XCode 4.2.
After this, my app ran successfully on the device using Command + R for Run.

Double click your app under targets in Xcode
Make sure that for the configuration 'Development' you have the right development provisioning
profiles selected.
click on the properties tag and make sure that the identifier is the same as the identifier used in
the development profile.
clean all targets, in Xcode make sure you are building for Device, Debug, and than click 'build and run'.
If the development profile is on your iPhone and you have installed it into Xcode correctly it should work. However sometimes after installing a profile on your iPhone it doesn't register everywhere it needs to and I have found that this is fixed by restarting the iPhone (not Xcode).
Good luck.

Related

App builds & runs in iPhone Simulator, but doesn't deploy to iPhone

The app I'm working on builds & runs just fine in the iPhone Simulator, but, when I try to test it on an iPhone 4S, XCode says, "Finished running ..." immediately after I click "Run", and, when I look at the iPhone, there's no icon for the app at all. It's as though XCode doesn't detect that XCode isn't deploying the app to the device.
I've got a signed certificate, a developer profile, and a valid provisioning profile (XCode's Organizer says so). The provisioning profile is present on the iPhone.
I've tried restoring the iPhone, and I still get the same error.
How do I successfully deploy my app to the iPhone?
Edit:
It's deep in the comments of the below answer, but the problem was that I had a misspelled within Info.plist's required Required device capabilities section. I solved it by deleting that row.
few things to check:
clean your build folders and rebuild. In Xcode project navigator, under products folder, is your app present?
open iTunes and try dragging this app into iTunes. Will it show up in iTunes or do you get an error? if it shows up, can you install it to iPhone via iTunes?
Is you iPhone iOS version and Xcode version and build settings all in sync? I know some version of Xcode 4.x have issues build and running apps on iOS 4.x.

Run on device gets "Finish running on device" message but never runs

I'm trying to run for the first time an app in a device.
XCode 4.2
iPhone 3G 4.2.1
I have a provisioning profile showing under Xcode organizer installed with a wildcard app identifier (DQQVZJ94G3.*).
The device lists in XCode organizer.
I have certificates installed in my Mac keychain and they show the private key.
I have created a new project from template and didn't add a single line of code.
I have set iPhone as my schema.
I have set under Build Settings->Code Signing->Code Signing Identity->Debug->Any iOs SDK-> the iOS Development Certificate/Provisioning Profile pair.
I have set the tagert deployment target as 4.1.
I have set Bulid Settings->Architectures to Standard(armv6)
I have removed from plist file "required devices capabilities"->armv7
All the previous settings are set up in the Target settings.
I have realunch xCode and reinstalled certificates and profiles.
Whenever I hit Run, I just get "Finish running myApp on iPhone", but nothing happens, not even a log to get a cue of what's happening.
Build settings are duplicated: there are project build settings and target build settings. Generally, if you change the project settings, the target settings are automatically changed, and this is useful if the project contains multiple targets. But sometimes, that doesn't work and you have the manually change the target settings which are the actual settings used to build the target. So start with that and verify that the target settings look like this:
Architectures : $(VALID_ARCHS)
Valid Architectures: armv6 armv7 (default value)
iOS Deployment target : iOS 4.2.1 or lower
If that doesn't work, then the problem is probably that the provisioning profile isn't correctly setup. An easy way to make sure it works correctly is to make Xcode manage it for you. So remove the provision profile from your device and from Organizer, also remove the developer profile from Organizer. Then plug the iPhone, right click on it in Organizer and select: Add Device to Provisioning Portal.
Edit
Make sure you remove the other values in Architectures. For example, in the screenshot below, you have to remove the selected line armv7.
I added armv6 as described in the other answer, then under Target, I had to remove "armv7" from "Required device capabilities"
I had the same problem and my solution ended up being that I didn't have my iPad's device ID added to my devices list.

iOS device is not listed in Xcode

I have done the provisional profile and it is showing properly in Organizer. Iphone device is also listed and next to it is a green little circle.
However, in xcode the device is not listed and can not be picked.
What can be the issue.
Have you click on "use for development" in organizer?
Click on your top project item, and check the Summary tab on your target.
Under Devices if you have selected iPad then it won't let you build to your iPhone.
Also, if the deployment target is higher than the version on your device it might not work.
Have you tried the following?
Restart Xcode
Restart the iOS Device
Restart your computer
I had the same issue and following worked for me in XCode 6.1
1: Open Devices (Window>Devices)
2: Select Device
3: Go to settings and Mark 'Show in Run Destination Menu'
There are a couple of issues that could be causing this.
1. Incorrect provisioning - Verify that you have specified the correct provisioning profile in "debug" in the build settings for both the project AND the target. Then make sure that that same provisioning profile has that device authorized on it (Apple Provisioning Portal) and that the profile has been installed on the device.
2. Proper deployment target value
3. Device Type - Make sure that your project is set for the correct device type (iPhone or iPad or Universal).
4. Restart Everything
I had the same exact issue. My problem was that I had accidentally installed the same provisioning profile twice. So when I clicked "Provisioning Profiles" (from the drop-down tree in Organizer below my device) it listed 2 instances of it -- one where the Team field showed my name and one where the Team field listed "Unknown". I deleted the "Unknown" instance and my device immediately showed up in my available devices list for testing.
For me, it was a simple case of having the deployment target set too high. I started the project on Xcode 7.3.1 on my work machine... but when I got home, I opened up the project with Xcode 7.2 (which does not have the 9.3 SDK). After changing it to the proper deployment target, voila... good to go.
And by simple, I mean I restarted, cleaned and screwed around with it for about 20 minutes before I smacked my head and saw the problem. :-)
For VMware Users
Goto menu VM->Settings->USB Controller->Change USB Compatibility 3.0 to 2.0 and then Check show all usb devices.
This worked for me. Now xcode is showing connected iphone device.
If show all usb devices option is disabled, power off virtual machine and try.

xcode cannot find the software image to install this version

I'm new to xCode development and struggling my way through the provisioning system trying to run a Hello World app on a real device. I went through al steps and everything seems fine but one thing:
When i click my device (Iphone 3G running IOS 4.2.1) in the xCode organizer the following message is displayed under Software Version: Xcode cannot find the software image to install this version...
Also the provisioning profiles show no status in the organizer (both in the library and on the device). On the provisioning portal they have the status active.
I hope someone can help me, thanks!!
ps. i am working with xcode 4
Update: OK, I've found the solution -> set deployment target to 4.2 in info tab: https://discussions.apple.com/thread/2780316?start=0&tstar
The message "xcode cannot find the software image to install this version" seen in the organiser window... This is just a notification rather than a problematic error.
If you want to eliminate this message anyway, I found I was able to do this by running restore within iTunes. Part of that process involves downloading some stuff, which I presume is the 'software image'.
But, as explained in Technical Q&A QA1569 "This message does not prevent you from using the device for development purposes. The only effect is the inability to reinstall the OS currently on the device using Xcode." ...and that has been my experience. Back in the main Xcode window you're still able to click 'run' and send the app to the device to run.
...and it will run assuming everything else is set-up OK, but there are various other gotchas related to Xcode 4.2 and v4 devices:
As mentioned by Overbeeke you should ensure the 'deployment target'
of your project is set down to the desired version (the minimum
version of the devices you want to support) Additionally I would
point out that the 'SDK version' should normally remain set to the
latest (it's whatever SDK Xcode on your machine is using)
As mentioned by Kenneth Lam, in the new Xcode you need to frig around
with "armv6/armv7" settings if you want to support earlier models of
iPhone. Follow these instructions to add the right "Architecture" armv6 setting. Additionally I would point out (as per this answer further down) that there is a setting called "Required device capabilities" from which you need to remove 'armv7'. This is in your app's plist file.
I'm saying all this like I'm an expert, but I still can't get it to work on a v3.1.3 device :-)
I think Xcode 4 requires that you are running the latest iOS to use that feature, but you don't need it to install apps on a device. I have run my apps on an iPod Touch 1G (which can't be upgraded to iOS 4.3) with the same iOS as you and it worked.
Have you added your device to the provisioning profile?
What I did is opened the organizer, right click on the device on the left pane and select "Add device to provisioning profile" where you will be asked for your Apple ID (within xcode) and it will add the device to your profile without you leaving xcode, much simpler than using the online portal.
Xcode 4.2 only builds armv7 targets by default. (Iphone 3G running IOS 4.2.1 is armv6) Add armv6 build targets by following these excellent instructions from Nick "Warning: iPhone apps should include an armv6 architecture" even with build config set
just an update, to update the iOS deployment target, click your project in the left pane, the one with the blue 'A' icon. click the build settings tab (not info), instead of showing "basic," show "all." iOS deployment target is in the deployment section.
There could be a number of things, but i would make sure that that your deployment taget in build settings is at or below your target . Check the "deployment section" in the build settings of your project. The default sets the deployment to the highest iOS version, if the ios version is below what is set you will not be able to run the app on that device.

Base SDK missing - red .app portion?

I am reading the provisioning profile stuff on the app store website and am having a heck of a time figuring everything out. I have my distribution certificates and everything but I think that something is massively messed up in xcode. When I switch to my distribution profile in the overview pulldown - it immediately changes to "Base SDK Missing". AND - when I scroll down to the projects portion on the left side - my .app file is red? Very confused.
The .app file is red because it hasn't been built yet for that specific set of build settings, which is normal behavior. The error is the "Base SDK Missing" message.
Have you installed multiple versions of Xcode? Are you perhaps editing a project with Xcode 3.2.3 that was created with an earlier version of Xcode? Xcode 3.2.3 only ships with the iOS 3.2 and 4.0 SDKs, meaning if your project was targeted for iOS 3.1.3 (for example), the new version of Xcode wouldn't have the correct SDK installed to build, resulting in that error message. You can try changing the "Base SDK" setting of the project to 3.2 or 4.0, make sure the correct "Configuration" option is selected from the drop down.
Distribution file is just for when you want to build for the AppStore, in which case all you can do is build the .app file (which is stored in the build directory of your project folder). You cannot run or debug that version of the app on a device since it is codesigned by Apple specifically for release in the AppStore only.
If you're just testing the waters or working on tutorials, try out the "Debug" option so you can install it on the device (iPod Touch, iPhone, iPad) in which case the provisioning profile is used to allow you to run the app on the device.
You can use whatever SDK you want via the same drop-down menu for the overview pulldown (i.e. 3.0, 3.1.3, 3.2, etc). You can also change this option in the Project settings menu for both the target and the project settings. There is a section called "Base SDK" in the Build menu I think.
The .app file will be red there in the project tree so don't worry about it and you'll never really need to do anything to that file in XCode. Just realize that it builds the actual .app file in your project folder in the Mac OS Finder.