Xcode 构建成功但未在 iPhone 上运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7779002/
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-09-14 22:08:19  来源:igfitidea点击:

Xcode Build Succeeded but not run on iPhone

iphoneiosxcode

提问by Piero

Possible Duplicate:
Is it possible to target older iOS versions when using Xcode 4.2 and iOS 5 SDK?

可能的重复:
使用 Xcode 4.2 和 iOS 5 SDK 时是否可以针对较旧的 iOS 版本?

I have a problem that i don't really understood, i'm using Xcode till yesterday and all work perfect, but yesterday i install Xcode 4.2 with iOS 5, but now when I try to do a run with my iPhone set as target is successfully build the application and then Stop immediately. No Errors, nothing in console logs. The application doesn't even copy over to my device. Xcode says: Building, Running, Finished Running....all within 2 seconds... On the simulator all works, but on the device nothing happen.

我有一个我不太明白的问题,直到昨天我都在使用 Xcode,并且一切正常,但是昨天我在 iOS 5 上安装了 Xcode 4.2,但是现在当我尝试将 iPhone 设置为目标时运行成功构建应用程序,然后立即停止。没有错误,控制台日志中没有任何内容。该应用程序甚至不会复制到我的设备上。Xcode 说:构建、运行、完成运行……2 秒内全部完成……在模拟器上一切正常,但在设备上什么也没有发生。

i have xCode 4.2 with iOS 5, and i have an iPhone 3G with io 4.2.1 and under the Deployment target i choose 4.2 like last day. Please help me i'm going crazy!

我有带 iOS 5 的 xCode 4.2,我有带 io 4.2.1 的 iPhone 3G,在部署目标下,我像昨天一样选择了 4.2。请帮帮我,我快疯了!

i see on the organizer window of Xcode, that the log give me this result, i copy a small part:

我在 Xcode 的组织者窗口上看到,日志给了我这个结果,我复制了一小部分:

Sat Oct 15 18:17:14 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:14 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:14 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:14 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:15 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:15 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:16 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:16 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:16 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:16 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:17 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:17 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:17 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:17 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:18 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing connection
Sat Oct 15 18:17:18 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:18 unknown com.apple.mobile.lockdown[18] <Notice>: Could not receive size of message
Sat Oct 15 18:17:18 unknown lockdownd[18] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from Xcode. Killing

What is the problem?

问题是什么?

P.S. i try to put the architecture to armv6 and build on the device is that the problem?...but how it's changed?...i have never changed the architecture on Xcode.

PS我尝试将架构放到armv6并在设备上构建是问题所在吗?...但它是如何改变的?...我从未改变过Xcode上的架构。

回答by HeikoG

you are right - the problem is probably that the 3G runs an amrv6 and you are only building for armv7

你是对的 - 问题可能是 3G 运行 amrv6 而你只是为 armv7 构建

in your build settings you find a setting for valid architectures. There should be one entry called armv7

在您的构建设置中,您可以找到有效架构的设置。应该有一个名为 armv7 的条目

just add another entry armv6 to that setting. that should do the trick

只需在该设置中添加另一个条目 armv6。这应该够了吧

回答by Khalil Ghaus

If you are using xcode 4.2 and want to install the app on to the device follow the steps that HeikoG tell but also after doing this it didn't help me. But at last I figured it out that in info.plist, they have defined "Required device capabilities" in key section, so just delete it and install the application.

如果您使用的是 xcode 4.2 并希望将应用程序安装到设备上,请按照 HeikoG 告诉的步骤进行操作,但在执行此操作后也没有帮助我。但是最后我发现在info.plist中,他们在关键部分定义了“必需的设备功能”,因此只需将其删除并安装应用程序即可。

回答by user1152262

There is also another place where you would have to add armv6. Its under the heading Architectures under category Architectures under Build Settings.

还有另一个地方你必须添加 armv6。它位于“构建设置”下的“架构”类别下的“架构”标题下。