xcode 是否只是仅限于英特尔 Mac 的 iPhone 模拟器?

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

Is it just the iPhone simulator that is restricted to Intel only Mac's?

iosxcodemacosios-simulator

提问by Clokey

I have read that the iPhone SDK (part of Xcode 3) is restricted to Mac's with the intel chipset. Does this restriction apply to only the simulator part of the SDK or the complete shebang?

我已经读到 iPhone SDK(Xcode 3 的一部分)仅限于使用英特尔芯片组的 Mac。此限制是否仅适用于 SDK 的模拟器部分或完整的shebang?

I have a Powerbook G4 running Leopard and would very much like to do dev on it rather than fork out for a new machine.

我有一台运行 Leopard 的 Powerbook G4,非常想在它上面做开发,而不是花钱买一台新机器。

It is also worth clarifying that I am interested in development for personal reasons and therefore accept that I would need a certified platform to create a submission for the App Store.

同样值得澄清的是,我出于个人原因对开发感兴趣,因此接受我需要一个经过认证的平台来为 App Store 创建提交。

回答by Clokey

As things have moved on since the original post on 3by9.com, here are the steps that I had to follow to get the environment working on my PowerBook G4.

自从 3by9.com 上的原始帖子以来事情已经发生了变化,以下是我必须遵循的步骤,以使环境在我的 PowerBook G4 上运行。

BTW, I would like to say that I realise that this is not a supported environment and I share this for purely pedagogic reasons.

顺便说一句,我想说我意识到这不是一个受支持的环境,我纯粹出于教学原因分享这个

  1. Download and install the iPhoneSDK (final version)
  2. After the install finishes, navigate to the packages directory in the mounted DMG
  3. Install all of the pkg's that start with iPhone
  4. Copy the contents of /Platformsto /Developer/Platforms(should be two folders starting with iPhone)
  5. Locate 'iPhone Simulator Architectures.xcspec' in /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specificationsand open in a text editor.
  6. Change line 12 to: Name = "Standard (iPhone Simulator: i386 ppc)";
  7. Change line 16 to: RealArchitectures = ( i386, ppc );
  8. Add the following to line 40 onwards:
  1. 下载并安装 iPhoneSDK(最终版)
  2. 安装完成后,导航到挂载的 DMG 中的包目录
  3. 安装所有以 iPhone 开头的 pkg
  4. 复制/Platformsto的内容/Developer/Platforms(应该是iPhone开头的两个文件夹)
  5. 找到“ iPhone Simulator Architectures.xcspec/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications并在文本编辑器中打开。
  6. 将第 12 行更改为: Name = "Standard (iPhone Simulator: i386 ppc)";
  7. 将第 16 行更改为: RealArchitectures = ( i386, ppc );
  8. 将以下内容添加到第 40 行之后:
    // PowerPC
    { Type = Architecture;
    Identifier = ppc;
    Name = "PowerPC";
    Description = "32-bit PowerPC";
    PerArchBuildSettingName = "PowerPC";
    ByteOrder = big;
    ListInEnum = NO;
    SortNumber = 106;
    },
  1. Save the file and start Xcode
  2. You should see under the New Project Folder the ability to create iPhone applications.
  3. To get an app to work in the simulator (and using the WhichWayIsUp example) open Edit Project Settings under the Project menu
  4. On the Build tab change the Architectures to: Standard (iPhone Simulator:i386 ppc)
  5. Change Base SDK to Simulator - iPhone OS 2.0
  6. Build and go should now see the app build and run in the simulator
  1. 保存文件并启动Xcode
  2. 您应该在 New Project Folder 下看到创建 iPhone 应用程序的能力。
  3. 要让应用程序在模拟器中工作(并使用 whichWayIsUp 示例),请打开“项目”菜单下的“编辑项目设置”
  4. 在 Build 选项卡上,将 Architectures 更改为:Standard (iPhone Simulator:i386 ppc)
  5. 将基础 SDK 更改为模拟器 - iPhone OS 2.0
  6. Build and go 现在应该可以看到应用程序在模拟器中构建和运行

回答by Chris Hanson

The iPhone SDK is documented to require an Intel-based Mac. Even if some people may be able to have gotten it to run on some other hardware doesn't mean that it will run correctly, that Apple will fix bugs you report, or that it is a supported environment.

iPhone SDK 被记录为需要基于 Intel 的 Mac。即使有些人可能能够让它在其他硬件上运行,但这并不意味着它会正确运行,Apple 会修复您报告的错误,或者它是受支持的环境。

回答by dbr

I have a Powerbook G4 running Leopard and would very much like to do dev on it

我有一台运行 Leopard 的 Powerbook G4,非常想在它上面做开发

Not sure what sort of application you are developing, but if you jailbreak your iPhone, you can:

不确定你正在开发什么样的应用程序,但如果你越狱了你的 iPhone,你可以:

  • develop applications using Ruby/Python/Java which won't require compiling at all
  • compile on the phone(!), as there is an GCC/Toolchain install in Cydia - although I've no idea how long that'll take, or if you can simply take a regular iPhone SDK project and SSH it to the phone, and run xcodebuild)
  • 使用 Ruby/Python/Java 开发完全不需要编译的应用程序
  • 在手机上编译(!),因为在 Cydia 中有一个 GCC/Toolchain 安装——虽然我不知道这需要多长时间,或者你是否可以简单地使用一个普通的 iPhone SDK 项目并将它的 SSH 连接到手机,并运行xcodebuild

You shouldbe able to compile iPhone applications from a PPC machine, as you can compile PPC applications from an Intel Mac, and vice-versa, there shouldn't be any reason you can't compile an ARM binary from PPC.. Wether or not Apple include the necessary stuff with Xcode to allow this is a different matter.. The steps that Ingmar postedseem to imply you can..?

应该能够从 PPC 机器编译 iPhone 应用程序,就像您可以从 Intel Mac 编译 PPC 应用程序一样,反之亦然,您没有任何理由不能从 PPC 编译 ARM 二进制文件。不是 Apple 在 Xcode 中包含必要的东西以允许这是另一回事.. Ingmar 发布的步骤似乎暗示您可以..?

回答by Chris Lundie

If you actually want to run your binary on the device, not just the simulator, you need the advice from the following page:

如果你真的想在设备上运行你的二进制文件,而不仅仅是模拟器,你需要来自以下页面的建议:

http://discussions.apple.com/thread.jspa?messageID=7958611

http://discussions.apple.com/thread.jspa?messageID=7958611

It involves a Perl script that does a bit of 'magic' to get the code signing to work on PowerPC. Also you need to install Developer Disk Image from the SDK packages. When all is said and done you can use a G4 to develop on the real device and even the debugger works. But I think Instruments doesn't work.

它涉及一个 Perl 脚本,该脚本执行一些“魔术”以使代码签名在 PowerPC 上工作。您还需要从 SDK 包中安装 Developer Disk Image。当一切都完成后,您可以使用 G4 在真实设备上进行开发,甚至调试器也可以工作。但我认为仪器不起作用。