从 Xcode 4.6.2 部署到 iOS 7(测试版)设备

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

Deploy from Xcode 4.6.2 to iOS 7 (beta) device

iphoneiosxcode

提问by xmorera

I installed iOS 7 yesterday to test in my iPhone 5. The problem is that I can't deploy now any test applications from Xcode to my iPhone as it says it has an unsupported version. I can't (or don't want to) downgrade from iOS 7 to 6 and don't want (can't) upgrade Xcode to version 5 as submitting is not supported with Xcode 5 Beta.

我昨天安装了 iOS 7 以在我的 iPhone 5 上进行测试。问题是我现在无法将任何测试应用程序从 Xcode 部署到我的 iPhone,因为它说它有一个不受支持的版本。我不能(或不想)从 iOS 7 降级到 6 并且不想(不能)将 Xcode 升级到版本 5,因为 Xcode 5 Beta 不支持提交。

So how do I deploy apps from Xcode 4.6.2 to iOS 7 Beta?

那么如何将应用程序从 Xcode 4.6.2 部署到 iOS 7 Beta?

回答by Dan1one

Well I don't know If this is of any help to anyone but me. But I have been able to use Xcode 4.6.2 to deploy to my iPhone 5 running iOS 7. I think it is due to a bug in the system but it doesn't matter to me. It works OK. Now to do this, I do as follows:

好吧,我不知道这对除我之外的任何人是否有帮助。但是我已经能够使用 Xcode 4.6.2 部署到运行 iOS 7 的 iPhone 5。我认为这是由于系统中的错误,但对我来说无关紧要。它工作正常。现在要做到这一点,我这样做:

  1. Make sure you have the latest version of Xcode from the App Store. (I don't know why, but why not?)

  2. Download and Install Xcode 5.

  3. Close all instances of Xcode running in your system (4.6.2 and 5)

  4. Run Xcode 5. you will see it recognizes your device, you probably have to activate it as use it for development again.

  5. Run Xcode 4.6.2 simultaneously. You will see it recognizes your iPhone as in: make it valid target for development.

  6. close or do whatever you want with Xcode 5. From this point onwards You can keep using Xcode 4.6.2

  1. 确保您拥有来自 App Store 的最新版本的 Xcode。(我不知道为什么,但为什么不呢?)

  2. 下载并安装 Xcode 5。

  3. 关闭系统中运行的所有 Xcode 实例(4.6.2 和 5)

  4. 运行 Xcode 5。你会看到它识别你的设备,你可能需要激活它才能再次使用它进行开发。

  5. 同时运行 Xcode 4.6.2。您将看到它识别您的 iPhone:使其成为开发的有效目标。

  6. 关闭或使用 Xcode 5 做任何你想做的事。从现在开始你可以继续使用 Xcode 4.6.2

I haven't turned my computer off or restarted it in a long time so I don't know if this is a fluke or what. But other people I work with have been able to do the same, so I expect it to work for you.

我已经很长时间没有关闭或重新启动计算机,所以我不知道这是侥幸还是什么。但是与我一起工作的其他人也能够做到这一点,所以我希望它对你有用。

EDIT:

编辑:

Better yet. Something I have found useful is building from Xcode 4.6.x to an iOS 7 device, actually makes the phone run it in iOS6 or before Mode which is the way all apps run at the moment. So my guess is that this would be what your app would look like in iOS 7 if deployed from the app store. Assuming you are targeting iOS 4+

更好。我发现有用的是从 Xcode 4.6.x 构建到 iOS 7 设备,实际上使手机在 iOS6 或之前的模式下运行它,这是目前所有应用程序运行的方式。所以我的猜测是,如果从应用商店部署,这将是你的应用在 iOS 7 中的样子。假设您的目标是 iOS 4+

Similarly, if you build the same app using Xcode 5, it tries to incorporate some iOS 7 appearance proxies by default and certainly the UI behaves differently. Granted I haven't played with Xcode 5 much, there is probably a toggle somewhere to turn this compatibility mode on and off.

同样,如果您使用 Xcode 5 构建相同的应用程序,默认情况下它会尝试合并一些 iOS 7 外观代理,并且 UI 的行为肯定会有所不同。诚然,我对 Xcode 5 的使用不多,可能在某处有一个开关可以打开和关闭此兼容模式。

回答by ShayanK

I was unable to upgrade MacOS from 10.7.5 to 10.8.x and that is why I could not install Xcode5 on my MAC. I downloaded Xcode5 but due to incompatibility it can not be installed.

我无法将 MacOS 从 10.7.5 升级到 10.8.x,这就是我无法在我的 MAC 上安装 Xcode5 的原因。我下载了 Xcode5,但由于不兼容,无法安装。

I was able to run app using XCode 4.6 in debug mode on an iPhone 4 with iOS 7 (and can't express enough how happy i got after that)

我能够在带有 iOS 7 的 iPhone 4 上以调试模式使用 XCode 4.6 运行应用程序(并且无法表达我在那之后有多高兴)

Steps:

脚步:

  1. Use incompatible Xcode5 (copy it from the dmg image to somewhere else, there will be a cross sign in it) and right click on it and Click "show package contents".
  2. Go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKsand copy the iPhoneOS7.0.sdk file in the corresponding folder in Xcode4.6 after showing its package contents.
  3. Go to Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupportand copy the 7.0 and 7.0.3(11B508) file in the corresponding folder in Xcode4.6 after showing package contents.
  1. 使用不兼容的 Xcode5(将它从 dmg 图像复制到其他地方,其中会有一个十字符号)并右键单击它并单击“显示包内容”。
  2. 进入Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs,将iPhoneOS7.0.sdk文件显示后复制到Xcode4.6对应文件夹下。
  3. 进入Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport,显示包内容后,将7.0和7.0.3(11B508)文件复制到Xcode4.6对应文件夹中。

Now when you open Xcode4.6 your project Base SDK should be 7.0 and if your device is not detected yet, disconnect and reconnect your device so that it starts "getting symbol files from iPhoneXYZ"

现在,当您打开 Xcode4.6 时,您的项目 Base SDK 应该是 7.0,如果尚未检测到您的设备,请断开连接并重新连接您的设备,以便它开始“从 iPhoneXYZ 获取符号文件”

Hope this helps someone.

希望这可以帮助某人。

One more important thing, in your scheme Debugger should be set to "LLDB"

更重要的一件事,在您的方案中,调试器应设置为“LLDB”

回答by elio.d

You can't. But you can have multiple version of xcode installed 4.6.x and 5.0.

你不能。但是您可以安装 4.6.x 和 5.0 的多个版本的 xcode。

once installed the 5.0 you can do something like this :

安装 5.0 后,您可以执行以下操作:

sudo xcode-select -switch /Applications/Xcode5.0.app

you can obviously switch back to the 4.6.x doing the same

你显然可以切换回 4.6.x 做同样的事情

回答by Saqib Saud

the best way I've found is.

我发现的最好方法是。

In Organizer, add iOS 7 ipsw file to "Software images" then unplug and replug the phone. tada! you should be able to deploy build on your iphone.

在管理器中,将 iOS 7 ipsw 文件添加到“软件图像”中,然后拔下并重新插入手机。多多!您应该能够在您的 iphone 上部署构建。

回答by Jonathan Wareham

In order to deploy from Xcode 4.6 to an iOS7 device all I had to do was install the new iTunes 11.1 beta 2 from the iOS Dev Center website (in the iOS7 GM seed section). No need to have Xcode 5 installed. I can now use Xcode 4.6 to fix the minor issues my app has with iOS7 and submit to the app store, retaining the iOS6 interface until I have time to give it a makeover for iOS7 (using Xcode 5).

为了从 Xcode 4.6 部署到 iOS7 设备,我所要做的就是从 iOS Dev Center 网站(在 iOS7 GM 种子部分)安装新的 iTunes 11.1 beta 2。无需安装 Xcode 5。我现在可以使用 Xcode 4.6 来修复我的应用程序在 iOS7 上的小问题并提交到应用程序商店,保留 iOS6 界面,直到我有时间为 iOS7 改造它(使用 Xcode 5)。

回答by MartenM

I suggest not to use the simulator here (though there are ways to enable the iOS7 simulator on Xcode4, but use real hardware instead. You probably have an iOS7 fueled device by now ;-)

我建议不要在这里使用模拟器(尽管有一些方法可以在 Xcode4 上启用 iOS7 模拟器,但请改用真正的硬件。你现在可能有一个支持 iOS7 的设备;-)

If you only need to have your app deployed on iOS7 while using XCode4 Damon's tipis sufficient. Debugging is limited to the log files :-/ but in my case it is the only solution, since I cannot install Xcode5 at all (waiting for the New Mac Pro ;-)).

如果您只需要在使用 XCode4同时将您的应用程序部署在 iOS7 上,Damon 的提示就足够了。调试仅限于日志文件:-/ 但在我的情况下,这是唯一的解决方案,因为我根本无法安装 Xcode5(等待新 Mac Pro ;-))。

So in that case

所以在那种情况下

  1. Archiving the product (Product > Archive) will compile as intended without warnings. Choose the base SDK flavour you like, but I recommend using the original (6.x?) instead of 7.
  2. From Organizer distribute for Ad Hoc development using the matching profile on your iOS7 device.
  3. Install the .ipa file on your iOS7 device using iTunes.
  1. 归档产品(产品 > 归档)将按预期编译而不会发出警告。选择您喜欢的基础 SDK 风格,但我建议使用原始版本 (6.x?) 而不是 7。
  2. 使用 iOS7 设备上的匹配配置文件从 Organizer 分发用于 Ad Hoc 开发。
  3. 使用 iTunes 在您的 iOS7 设备上安装 .ipa 文件。

A bit of a hassle, but the most stable way if you don't have XCode5 installed.

有点麻烦,但如果您没有安装 XCode5,这是最稳定的方法。

回答by DJ van Wyk

We needed to install the beta version of XCode 5 on another workstation. With that version you can provision the iOS 7 device for development. Back on the normal production workstation with XCode 4 you add the provisioning profile to the iOS 7 device (now that Organizer actually recognizes it. Then build and deploy the code through XCode 4 to the device.

我们需要在另一个工作站上安装 XCode 5 的测试版。使用该版本,您可以配置 iOS 7 设备进行开发。回到带有 XCode 4 的普通生产工作站上,您将配置文件添加到 iOS 7 设备(现在 Organizer 确实可以识别它。然后通过 XCode 4 构建和部署代码到设备。

回答by Nur Iman Izam

Make sure you have both XCode versions installed.

确保您安装了两个 XCode 版本。

Apparently, you can try launching XCode 5 and try building the app from there. After that, close XCode 5 and run XCode 4.6.2. and try building for the same device.

显然,您可以尝试启动 XCode 5 并尝试从那里构建应用程序。之后,关闭 XCode 5 并运行 XCode 4.6.2。并尝试为同一设备构建。

Although I have iOS7 on my device. I'm still able to build using XCode 4.6.2. Upon restarting the phone though, it may be disabled and you have to do the same procedure again.

虽然我的设备上有 iOS7。我仍然可以使用 XCode 4.6.2 进行构建。但是,重新启动手机后,它可能会被禁用,您必须再次执行相同的程序。

回答by user2959565

You can't debug iOS 7 directly, but you can use the Organizer in XCode to view logs. You do this as follows:

您无法直接调试 iOS 7,但您可以使用 XCode 中的管理器查看日志。您可以按如下方式执行此操作:

  1. Deploy to the device as normal (run, or create an ipa file and push to device) Note:If you run the application, XCode will go through it's standard processes and fail on execution. Just stop the application at this point.
  2. In XCode 4.x, open the Organizer.
  3. Navigate to Devices and open up the device that you have connected to your Mac.
  4. Select Console for your device.
  5. Clear the current logs by selecting the Clear button at the bottom.
  6. On your device, run the application manually.
  7. Now in the Console, you should see any logs that you've put in place in the code.
  1. 正常部署到设备(运行,或创建一个 ipa 文件并推送到设备)注意:如果您运行该应用程序,XCode 将通过其标准流程并在执行时失败。此时只需停止应用程序。
  2. 在 XCode 4.x 中,打开管理器。
  3. 导航到设备并打开您已连接到 Mac 的设备。
  4. 为您的设备选择控制台。
  5. 通过选择底部的清除按钮清除当前日志。
  6. 在您的设备上,手动运行应用程序。
  7. 现在在控制台中,您应该会看到您在代码中放置的所有日志。

This isn't the most efficient way to debug, but it's definitely better than not having any way to do it at all. Hopefully this helps.

这不是最有效的调试方法,但绝对比根本没有任何方法要好。希望这会有所帮助。

回答by Chris Paveglio

If you have multiple start up partitions/drives, you can install Xcode 5 on one disk. Start up with that system and validate the iPhone for development. Then restart in the other disk with Xcode 4.6 and it will still be recognized as a development device and allow apps to install/test/etc. I've done this and it works fine for me. I have OS 10.8 and Xcode 4.6 on my "main" drive, and OS 10.9 and XCode 5 on another ("testing") drive. Works for me, but this could change with any later OS or XCode update of course.

如果您有多个启动分区/驱动器,您可以在一张磁盘上安装 Xcode 5。使用该系统启动并验证 iPhone 以进行开发。然后使用 Xcode 4.6 在另一个磁盘中重新启动,它仍然会被识别为开发设备并允许应用程序安装/测试/等。我已经这样做了,对我来说效果很好。我的“主”驱动器上有 OS 10.8 和 Xcode 4.6,另一个(“测试”)驱动器上有 OS 10.9 和 XCode 5。对我有用,但这当然可能会随着任何以后的操作系统或 XCode 更新而改变。