简体   繁体   English

Xcode 4.2-应用程序无法在硬件上运行-找不到错误消息

[英]Xcode 4.2 — App doesn't run on hardware — no error messages to be found

I have an app built on Xcode 4.2, iOS 5, deployment target iOS 4.2, building for debug, with valid identity/provisioning profile (they work under Xcode 3), phone (actually an iPod Touch 4.2.1) plugged in and acknowledged by Organizer, showing the provisioning profile. 我有一个基于Xcode 4.2,iOS 5,部署目标iOS 4.2构建的应用程序,用于调试,具有有效的身份/配置文件(它们在Xcode 3下工作),电话(实际上是iPod Touch 4.2.1)并已插入并得到确认组织者,显示配置文件。

The app runs fine under the simulator, but when I compile/run for the Touch it says "Build Succeeded" and then immediately afterwards "Finished running XXX on iPod Touch" appears in the build progress box. 该应用在模拟器下运行良好,但是当我为Touch编译/运行时,它显示“ Build Succeeded”,然后紧接着在构建进度框中显示“在iPod Touch上运行XXX完成”。 Neither the Xcode console nor the Touch's console show any messages. Xcode控制台和Touch控制台均不显示任何消息。 No device logs either. 也没有设备日志。 The application doesn't appear as installed on the device. 该应用程序未显示为已安装在设备上。 Breakpoint at entry to applicationDidBecomeActive is never hit. 从不击中applicationDidBecomeActive入口处的断点。

Any idea what's wrong? 知道有什么问题吗? I've searched Xcode 4 high and low for any sign of a build log that might contain hidden build/deployment error messages, but can't find anything. 我已经在Xcode 4的上下搜索了可能包含隐藏的构建/部署错误消息,但找不到任何内容的构建日志的任何迹象。

I did find this thread, but mucking with the "Architecture" stuff produced no change. 我确实找到了线程,但是对“体系结构”的东西进行修改不会产生任何变化。

Aha!! 啊哈! There are "Architecture" entries under both "PROJECT" and "TARGETS" and I was mucking with "PROJECT". 在“ PROJECT”和“ TARGETS”下都存在“ Architecture”条目,而我当时对“ PROJECT”却一无所知。 Setting the "Architecture" under "TARGETS" caused it to start working. 在“ TARGETS”下设置“ Architecture”会使其开始工作。 (YOY do they have both, when one is ignored, and YOY don't they produce some sort of error message in this situation?) (当它们被忽略时,它们同时具有两者,并且在这种情况下它们不会产生某种错误消息吗?)

What device are you trying to run on? 您想在什么设备上运行? It is likely you need to add "armv6" as a build architecture. 您可能需要添加“ armv6”作为构建体系结构。 XCode doesn't do a good job of telling what's wrong in this case. 在这种情况下,XCode不能很好地说明问题所在。 Try the following. 尝试以下方法。

  1. Select your project at the top of the Project Navigator and choose Build Settings in the right pane. 在“项目浏览器”顶部选择您的项目,然后在右窗格中选择“构建设置”。

  2. Select the ARCHS setting under Architectures and add "armv6" by choosing "Other..." 在“架构”下选择ARCHS设置,然后通过选择“其他...”添加“ armv6”

  3. Make sure the ONLY_ACTIVE_ARCH is set to "No" 确保将ONLY_ACTIVE_ARCH设置为“否”

  4. Make sure that VALID_ARCHS is set to "armv6 armv7" 确保将VALID_ARCHS设置为“ armv6 armv7”

Also, the place you see the error message is in Organizer. 此外,您看到错误消息的位置在管理器中。 Select the device you're trying to run on and choose 'Console'. 选择您要在其上运行的设备,然后选择“控制台”。 You'll see an error after you try to run the app. 尝试运行该应用后,您会看到一个错误。

Turns out that there are "Architecture" entries under both "PROJECT" and "TARGETS" and I was mucking with "PROJECT". 原来在“ PROJECT”和“ TARGETS”下都存在“ Architecture”条目,而我在想着“ PROJECT”。 Setting the "Architecture" under "TARGETS" caused it to start working. 在“ TARGETS”下设置“ Architecture”会使其开始工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM