ios Xcode 4 在目标设备上显示“已完成运行 <我的应用>”——没有任何反应

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5292286/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 19:12:46  来源:igfitidea点击:

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

iphoneiosxcodexcode4ipod-touch

提问by D-Nice

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.

状态栏显示 Xcode 正在构建我的项目,然后显示正在运行我的项目,然后显示“已完成运行”。在整个期间,iPod 屏幕保持黑色。正在管理器中检测到 iPod,我看不出它的配置有任何问题。几天前使用 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.

它在模拟器上不起作用,但重要的是要注意,在模拟器中它似乎卡在“附加到”并且模拟器拒绝启动。

回答by MattyG

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).

对于那些阅读有关 Xcode 4.2 并尝试在早期设备(例如 iPhone 3G、2G、iPod 1st gen 等)上运行的人,我有另一个解决方案。默认情况下,在 Xcode 4.2 中创建的新项目在“Required Device Capabilities”中指定“armv7”。如果想要支持运行 armv6 的设备(例如 iPhone 3G),您需要删除它。

enter image description here

在此处输入图片说明

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

从 yourProjectName-Info.plist 中的“所需设备功能”中删除 armv7

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

您可能还需要更改构建设置以使用 armv6 而不是 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':

双击“标准(armv7)”添加另一个,然后在弹出窗口中单击“+”,然后输入“armv6”:

enter image description here

在此处输入图片说明

Click done and it should look like this:

单击完成,它应该如下所示:

enter image description here

在此处输入图片说明

回答by axiixc

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.

我刚遇到这个问题,但对我来说是因为我只在我的架构中指定了 armv7,而 3G 是 armv6。确保你两者都有。

回答by Jeremy Flores

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.

我遇到了这个问题,结果是 XCode 将部署目标默认为 4.3,而我的手机是 4.2.1。将部署目标更改为 4.0 似乎解决了它。

回答by Johann

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!

将“armv6”添加到项目和目标的架构后,请确保 info.plist 的“所需设备功能”部分中没有“armv7”。如果是这样,只需删除它,它应该可以工作!

回答by SPitBalls.com

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.

应用程序未在设备上运行的相同问题。从设备中删除应用程序没有帮助。Project -> Clean 然后 Project -> Run again 也没有帮助。原来只是退出并重新启动 Xcode 4 解决了它。

回答by Graham Perks

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.

我也刚有这个。我在 info.plist 中添加了一个 UIRequiredDeviceCapabilities 部分,需要游戏套件,并且该应用程序不会被复制到运行 iOS 4.2 的 iPhone 3G 上。删除了所需的能力,一切都很好。

回答by Tomek Kopczuk

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.

尝试删除设备上的应用程序(就像您通常卸载应用程序一样)并再次从 Xcode 运行它。帮助我解决了同样的问题,除了模拟器不工作。

回答by Casey

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

我的情况:我错误地设置了:Required device capabilities -> accelerometer 为 NO(在 Info.plist 中)。只需将其设置回 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.

另外:确保所需的设备功能是正确的类型:即布尔或字符串。错误的类型总是会导致测试失败,并且应用程序无法加载。

回答by red_car

adding armv6 architecture fixed this for me.

添加 armv6 架构为我解决了这个问题。

回答by Luke

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.

对于那些仍在苦苦挣扎的人,我必须做的另一件事是使目标产品的名称与调试和发布配置相同。它一直在“运行”调试版本,我没有构建它。