Xcode 4 says "finished running <my app>" on the targeted device -- Nothing happens
Asked Answered
U

25

222

The app neither installs nor runs on my device. All provisioning profiles are up to date. I've already tried deleting and re-installing them.

The status bar shows that Xcode is building my project, then it says running my project on , then it says "finished running ." Throughout this entire period, the iPod screen stays black. The iPod is being detected in the Organizer and I don't see anything wrong with its configuration. Everything was working perfectly just a couple days ago with Xcode 3.

It doesn't work on the simulator, but it may be important to note that in the simulator it appears to get stuck on "Attaching to " and the simulator refuses to start.

Unmoving answered 13/3, 2011 at 20:48 Comment(3)
If you create a brand-new project using one of the xcode templates and try to run it in either the simulator or the device will it work? I'm trying to determine if the install/configuration of xcode is broken or if something in the app you are asking about is influencing the behavior.Wennerholn
Created a new project template and it worked. So now we know that something must be misconfigured in my project.Unmoving
D-Nice, did you ever solve this? I'm having this exact same issue with my game, and I cannot solve it for the life of me.Buckshot
U
266

For those reading this in regards to Xcode 4.2, and attempting to run on an earlier device (e.g. iPhone 3G, 2G, iPod 1st gen, etc) I have another solution. New projects created in Xcode 4.2 by default specify 'armv7' in the 'Required Device Capabilities'. You'll need to remove this if wanting to support devices that run armv6 (e.g. the iPhone 3G).

enter image description here

Delete armv7 from the 'Required device capabilities' in yourProjectName-Info.plist

You may also need to change the build settings to compile with armv6 instead of armv7.

This is the default:

enter image description here

Double click on 'Standard (armv7)' to add another, then click the '+' in the popup, and type in 'armv6':

enter image description here

Click done and it should look like this:

enter image description here

Uncommunicative answered 17/10, 2011 at 1:21 Comment(7)
Bingo: I had to do the two steps described in order to run properly on my old iPhone 3G. Thanks MattyG!Fults
Thanks a million! I'd give you 10 vote ups if I could. I was going through all the scenarios on this page with no luck at all. Somehow that value must have been changed when I upgraded to XCode 4.3.Remonstrant
Fantastic, this was my problem. I didn't have entry in my plist file, so I ignored the first part, but the second part of your posted fixed my issues! Thanks!Heisser
MattyG says to remove the 'armv7' value in your <TARGET>-Info.plist file. To be clear, this means click the minus button to entirely remove the value. At first, I simply blanked out the value (but left in the subtree value of Item 0), and I still suffered from OP's problem. Be sure to completely delete the subtree Item 0.Dextrin
Thanks from me too! Many people have suggested of adding in 'armv6', but removing armv7 is the trick!Odawa
"Delete armv7 from the 'Required device capabilities' in yourProjectName-Info.plist" --> ThanksLaurence
Another case that leads to the same problem is if you added an empty entry to the required device capabilities.Anis
J
43

I just had this problem, but for me it was because I only specified armv7 in my architectures, but the 3G is armv6. Make sure you have both.

Jonajonah answered 2/7, 2011 at 1:42 Comment(4)
That was the main cause for me. So easy to forget it. Thanks.Weintrob
For adding the "armv6" option, see this: #7489157Stasiastasis
My older iPod Touch must also be armv6 because this fixed worked for it too.Cepeda
Yeah, I'm pretty sure the original iPhone, 3G, and the first two iPod touches were armv6.Jonajonah
T
21

I had this issue, and it turns out that XCode was defaulting the Deployment Target to 4.3, whereas my phone is 4.2.1. Changing the Deployment Target to 4.0 seemed resolve it.

Tletski answered 14/4, 2011 at 21:18 Comment(1)
I had this issue when setting deployment target to 5.1 when my device was only upto 5.0.1 - cheers mate +1Keslie
M
12

After you add "armv6" to the Project and Targets' architectures, make sure you don't have "armv7" in your "Required device capabilities" section of your info.plist. If so just remove it and it should work!

Manysided answered 12/12, 2011 at 9:53 Comment(1)
Yup, this is the reason for my case. No idea how the "Required device capabilities" of armv7 got in the plist. Thanks!Lavina
J
11

Same problem here with the app not running on the device. Deleting the app from the device didn't help. Project -> Clean then Project -> Run again didn't help either. Turned out that just Quitting and restarting Xcode 4 solved it.

Jsandye answered 7/4, 2011 at 21:52 Comment(0)
D
9

I just had this too. I had added a UIRequiredDeviceCapabilities section to info.plist, requiring gamekit, and the app would not get copied onto an iPhone 3G running iOS 4.2. Removed the required capability, all is well.

Definite answered 28/4, 2011 at 1:55 Comment(2)
How are you supposed to test apps that require gamekit on the device itself, then?Nearsighted
You still get GameCenter without your info.plist saying you require a device that has it. Any device running 4.2 has GameCenter, so there's no need for the additional info.plist "I need it!"Definite
L
6

Try deleting the app on the device (just like your usual app uninstall) and running it from Xcode again. Helped me with the same problem, apart from the simulator not working.

Lipo answered 14/3, 2011 at 0:14 Comment(1)
There's no trace of the app on the device any longer. I no longer think this is a provisioning issue... there's something that got corrupted in my project, but I have no clue as to what it may be.Unmoving
B
6

Mine case: I mistakenly set the: Required device capabilities -> accelerometer to NO (in Info.plist). Just have to set it back to YES

Also: Make sure that the Required device capabilities is of the proper type: i.e. Boolean or String. The wrong type will invariably make the test fail, and the app not load.

Behalf answered 28/7, 2011 at 9:55 Comment(0)
C
4

For those still floundering, another thing that I had to do was make the name of my target's product the same for Debug and Release configurations. It had been "running" the Debug version, which I was not building.

Corfam answered 27/5, 2011 at 20:6 Comment(0)
P
4

adding armv6 architecture fixed this for me.

Pelion answered 8/7, 2011 at 6:53 Comment(1)
this was it for me; the new version of Xcode decides to remove armv6 from the 'Architectures' build setting so you will need to add it back manuallyDriven
G
2

Happens to me sometimes as well. Doing clean (Product menu -> Clean) and run (Project menu -> Run) always fixes it.

Gerick answered 14/3, 2011 at 8:34 Comment(1)
Thanks! This happens often. Each time I try something new! Is this a bug in Xcode?Acetylide
T
2

I had the same problem: migrated a project from xcode3 to xcode4, and after building the app, xcode did not want to install and start the App on my phone.

My solution (that worked for me) is:

  • Edit your scheme (which is meant to be run)
  • In the list on the left, select 'Run xyz.app'
  • Under the info tab, at Executable I had '.app' selected. Change this by browsing to your build directory and choosing your app.

Worked for me, and from now on I can use: 'Product -> Perform Action -> Run without building', for running the latest build. This is faster then simply pressing Run, as no build actions will be taken.

Throaty answered 13/9, 2011 at 15:3 Comment(1)
there is no build directory for mine? weird.Murillo
C
1

Just restart the device. Do an clean project. Delete the app from the device and Rebuild.

Consequent answered 12/12, 2011 at 15:44 Comment(0)
G
0

Build settings were different for project and targets. I just press suppr on Build Products Path and Intermediate Build Files Path in both sections and it solved my problem.

Grafting answered 2/9, 2011 at 9:7 Comment(0)
P
0

I had the same problem with my game project using Cocos2D. "Hello world" from template worked fine, my project worked fine in simulator, but running failed on device with message: "Finished running".

I've replaced Info.plist in my project by the initial one from template and that worked for me!

Pyridine answered 5/9, 2011 at 9:50 Comment(0)
R
0

I experienced this twice with two different apps when moving to the most recent Xcode version. The first time, what worked was compiling the app with the GCC LLVM compiler. The second time, what worked was adding back in the armv6 architecture as a supported architecture since it had been removed when Xcode automatically updated the project.

Ratepayer answered 12/10, 2011 at 15:11 Comment(0)
P
0

I solved this by changing "accelerometer" from "NO" to "YES" in my Info.plist.

Apple's Information Property List Key Reference says that you can remove the "accelerometer" setting entirely if "your application detects only device orientation changes."

Pursuant answered 20/10, 2011 at 12:26 Comment(1)
your app supports accelerometer?Pianola
G
0

My solution was to add UIInterfaceOrientationPortrait to the UISupportedInterfaceOrientations array in Info.plist, even though my app does not support portrait.

Gametogenesis answered 22/12, 2011 at 5:8 Comment(0)
A
0

A field called "Application requires iPhone environment" had made it's way into my plist somehow. I removed it and voila! It ran on my iPod.

Acetylide answered 28/5, 2012 at 9:18 Comment(0)
A
0

My Info.plist had it's target membership set to my build target. Removing it from the target membership solved the problem.

Apelles answered 2/6, 2012 at 3:36 Comment(0)
B
0

I was using an alternate name for Info.plist but had not correctly set the Info.plist File build setting on my target. I discovered this by looking at the Application Bundle and seeing that it did not contain an Info.plist.

Bruiser answered 22/6, 2012 at 20:46 Comment(0)
Q
0

Make sure that the deployment target version is <= the iOS version on your device. This is how i solved this problem.

Quadrivial answered 25/7, 2012 at 13:15 Comment(0)
E
0

I was having the same problem for about 45 minutes now. Cleaning didn't help, re-creating the project didn't help, the arm version didn't help. I had some "Could not sync to iTunes" messages open that I didn't see before. Clicking OK on those seemed to have fixed the issue :(

Erbe answered 29/8, 2012 at 21:39 Comment(0)
K
0

XCode build, run and finished but the app failed to be deployed and was not even copied to the device.

In fact, there should be something in the XCode project that is broken. The best move is to build a new project from scratch. Don't forget to add armv6 support as stated in a previous post.

It works well for me!

Kilocycle answered 27/9, 2012 at 2:24 Comment(0)
B
0

This happened to me trying to run a watchOS app on device, because my Apple Watch's watchOS version was higher than my currently-installed Xcode supported. I upgraded to the newest Xcode (which did also require me to upgrade to the newest macOS), and it ran fine after that.

Bronson answered 3/6, 2019 at 22:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.