在没有 Mac 的情况下构建 iOS 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18739387/
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
Build an iOS app without owning a mac?
提问by Cescy
Please correct me if I'm wrong.
如果我错了,请纠正我。
I'm new to mobile development and I would like to develop an app to submit to the apple store.
我是移动开发的新手,我想开发一个应用程序提交给苹果商店。
But I am heavily discouraged by the prices of the macs that I am developing the app in mind.
但是我对我正在开发该应用程序的 Mac 的价格感到非常沮丧。
Let's say I know exactly what I want and how to code it.
假设我确切地知道我想要什么以及如何编码。
If I was to create a developers account and pay the fee - then borrow my friends mac, write the code and submit my code to apple. Is that all I need the mac for? And then I'll be able to access all the stats etc through iTunes on my windows computer?
如果我要创建一个开发者帐户并支付费用-然后借用我的朋友mac,编写代码并将我的代码提交给苹果。这就是我需要的 mac 吗?然后我就可以在我的 Windows 计算机上通过 iTunes 访问所有统计信息等?
Can someone please tell me I'm delusional?
有人可以告诉我我是妄想吗?
采纳答案by swiftBoy
Let me tell you step by step few years back I was in same situation.
让我一步一步地告诉你几年前我也处于同样的情况。
So We have two Phases
所以我们有两个阶段
- iPhone/iPad (iOS) app development
- iPhone/iPad (iOS) app development and Publish to iTunes Store
- iPhone/iPad (iOS) 应用程序开发
- iPhone/iPad (iOS) 应用程序开发和发布到 iTunes Store
1. iPhone/iPad (iOS) app development
1. iPhone/iPad (iOS) 应用程序开发
So If you just want to develop iOS apps you don't want to pay anything,
所以如果你只是想开发 iOS 应用程序你不想支付任何费用,
You just need Mac + XCode IDE
你只需要 Mac + XCode IDE
- Get Mac Mini or Mac Machine
- Create Developer Account on Apple its free
- After login developer account you can download Xcode IDE's .dmg file
- That's all.
- 获取 Mac Mini 或 Mac Machine
- 免费在 Apple 上创建开发者帐户
- 登录开发者账号后,您可以下载 Xcode IDE 的 .dmg 文件
- 就这样。
Now you just install Xcode and start developing iOS apps and test/debug with Simulator..
现在您只需安装 Xcode 并开始开发 iOS 应用程序并使用模拟器进行测试/调试。
2. iPhone/iPad (iOS) app development and Publish to iTunes Store
2. iPhone/iPad (iOS) 应用程序开发和发布到 iTunes Store
for publishing your app on iTunes store you need to pay (example $99 / year) .
要在 iTunes 商店上发布您的应用程序,您需要付费(例如 99 美元/年)。
So For complete iOS Development Setup you need
因此,对于完整的 iOS 开发设置,您需要
- Get Mac Mini or Mac Machine
- Create Developer Account on Apple its free
- After login developer account you can download Xcode IDE's .dmg file
- pay $99 for publish apps on iTunes
- create your certificates for development/distribution on your apple account
- download all certificate on mac machine and install into XCode using Keychain tool
- Get at least one iOS Device
- Register you device on your apple account
- Now you can develop iOS app, test on Real Device and also publish on iTunes Store
- 获取 Mac Mini 或 Mac Machine
- 免费在 Apple 上创建开发者帐户
- 登录开发者账号后,您可以下载 Xcode IDE 的 .dmg 文件
- 在 iTunes 上发布应用程序支付 99 美元
- 在您的苹果帐户上创建用于开发/分发的证书
- 在 mac 机器上下载所有证书并使用 Keychain 工具安装到 XCode 中
- 获得至少一台 iOS 设备
- 在您的苹果帐户上注册您的设备
- 现在您可以开发 iOS 应用程序,在真实设备上进行测试,也可以在 iTunes Store 上发布
回答by wha7ever
Update from 09/2017
09/2017 更新
It is possible to develop iOS (and Android at the same time) application using React Native+ Expowithout owning a mac. You will also be able to run your iOS application within iOS Expo appwhile developing it. (You can even publish it for other people to access, but it will only run within Expo app). Here is pagefrom Expo on how to generate standalone app.
可以使用React Native+ Expo开发 iOS(和 Android 同时)应用程序,而无需拥有 mac。您还可以在开发时在iOS Expo 应用程序中运行您的 iOS 应用程序。(您甚至可以发布它供其他人访问,但它只能在 Expo 应用程序中运行)。这是Expo 上关于如何生成独立应用程序的页面。
Steps from that page:
该页面的步骤:
One: Install exp
by running npm install -g exp
一:exp
通过运行安装npm install -g exp
Two: Configure app.json (somewhere along these lines):
二:配置 app.json(沿着这些路线的某个地方):
{
"expo": {
"name": "Your App Name",
"icon": "./path/to/your/app-icon.png",
"version": "1.0.0",
"slug": "your-app-slug",
"sdkVersion": "17.0.0",
"ios": {
"bundleIdentifier": "com.yourcompany.yourappname"
},
"android": {
"package": "com.yourcompany.yourappname"
}
}
}
Three: Start exp
packeger with exp start
三:启动exp
打包机exp start
Four: run exp build:android
or exp build:ios
.
四:跑exp build:android
或exp build:ios
。
You will be prompted for some input. For android you can choose 1) Let Expo handle the process!
if you don't have keystore (or if you don't know what it is). For iOS you will have to enter your Apple developer credentials. Then you can provide distribution certificate or let expo handle it.
系统将提示您进行一些输入。对于 android,您可以选择1) Let Expo handle the process!
是否没有密钥库(或者您不知道它是什么)。对于 iOS,您必须输入您的 Apple 开发人员凭据。然后你可以提供分发证书或者让expo来处理。
Five: Once in a while you will have to come back and run exp build:status
command to check whether your build was complete. If complete you will be provided a direct link to .apk
or .ipa
file.
五:偶尔你将不得不回来运行exp build:status
命令来检查你的构建是否完成。如果完成,您将获得指向.apk
或.ipa
文件的直接链接。
The only drawback to this approach is that it won't be as native as writing iOS app in Swift, and you will have to put up with parade of issues you may run into while developing with weakly typed js, npm, and it's dependency-on-particular-version-of-some-other-libraryissues, and other stuff.
这种方法的唯一缺点是它不会像在 Swift 中编写 iOS 应用程序那样原生,并且您将不得不忍受在使用弱类型 js、npm 进行开发时可能遇到的一系列问题,而且它是依赖项——关于某个其他库问题的特定版本以及其他内容。
回答by Donald Duck
On Windows, you can use Mac on a virtual machine (this probably also works on Linux but I haven't tested). A virtual machine is basically a program that you run on your computer that allows you to run one OS in a window inside another one. Make sure you have at least 60GB free space on your hard drive. The virtual hard drive that you will download takes up 10GB initially but when you've installed all the necessary programs for developing iOS apps its size can easily increase to 50GB (I recommend leaving a few GBs margin just in case).
在 Windows 上,您可以在虚拟机上使用 Mac(这可能也适用于 Linux,但我还没有测试过)。虚拟机基本上是一个您在计算机上运行的程序,它允许您在另一个窗口内的窗口中运行一个操作系统。确保您的硬盘驱动器上至少有 60GB 的可用空间。您将下载的虚拟硬盘最初占用 10GB,但是当您安装了开发 iOS 应用程序所需的所有程序后,它的大小可以轻松增加到 50GB(我建议留出几 GB 的空间以防万一)。
Here are some detailed steps for how install a Mac virtual machine on Windows:
以下是有关如何在 Windows 上安装 Mac 虚拟机的一些详细步骤:
Install VirtualBox.
You have to enable virtualization in the BIOS. To open the BIOS on Windows 10, you need to start by holding down the Shiftkey while pressing the Restart button in the start menu. Then you will get a blue screen with some options. Choose "Troubleshoot", then "Advanced options", then "UEFI Firmware Settings", then "Restart". Then your computer will restart and open the BIOS directly. On older versions of Windows, shut down the computer normally, hold the F2key down, start your computer again and don't release F2until you're in the BIOS. On some computers you may have to hold down another key than F2.
Now that you're in the BIOS, you need to enable virtualization. Which setting you're supposed to change depends on which computer you're using. This may vary even between two computers with the same version of Windows. On my computer, you need to set
Intel Virtual Technology
in theConfiguration
tab toEnabled
. On other computers it may be in for exampleSecurity -> Virtualization
or inAdvanced -> CPU Setup
. If you can't find any of these options, search Google forenable virtualization (the kind of computer you have)
. Don't change anything in the BIOS just like that at random because otherwise it could cause problems on your computer. When you've enabled virtualization, save the changes and exit the BIOS. This is usually done in theExit
tab.Download this file(I uploaded the file which I previously downloaded from a link which is now broken). If the link gets broken, post a comment to let me know and I will try to upload the file somewhere else. The password to open the 7Z file is
stackoverflow.com
. This 7Z file contains a VMDK file which will act as the hard drive for the Mac virtual machine. Extract that VMDK file. If disk space is an issue for you, once you've extracted the VMDK file, you can delete the RAR file and therefore save 7GB.Open VirtualBox that you installed in step 1. In the toolbar, press the New button. Then choose a name for your virtual machine (the name is unimportant, I called it "Mac"). In "Type", select "Mac OS X" and in "Version" select "Mac OS X 10.11 El Capitan (64 bit)".
Select the amount of memory that your virtual machine can use. Try to balance the amount because too little memory will result in the virtual machine having low performance and a too much memory will result making your host system (Windows) run out of memory which will cause the virtual machine and/or other programs that you're running on Windows to crash. On a computer with 4GB available memory, 2GB was a good amount. Don't worry if you select a bad amount, you will be able to change it whenever you want (except when the virtual machine is running).
In the Hard disk step, choose "Use an existing virtual hard disk file" and click on the little folder icon to the right of the drop list. That will open a browse window. Select the VMDK file that you downloaded and extracted in step 4.
When you're done with this, click "Create".
Select the virtual machine in the list on the left of the window and click on the Settings button in the toolbar. In System -> Processor, select 2 CPUs. If you realize later that you selected an amount of memory in step 6 that causes problems, you can change it in System -> Motherboard. When you're done changing the settings, click OK.
Open the command prompt (
C:\Windows\System32\cmd.exe
). Run the following commands in there, replacing"Your VM Name"
with whatever you called your virtual machine in step 5 (for example"Mac"
) (keep the quotation marks):cd "C:\Program Files\Oracle\VirtualBox\" VBoxManage.exe modifyvm "Your VM Name" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" W1234567980
Now everything is ready for you to use the virtual machine. In VirtualBox, click on the Start button and follow the installation instructions for Mac. Once you've installed Mac on the virtual machine, you can develop your iOS app just like if you had a real Mac.
安装VirtualBox。
您必须在 BIOS 中启用虚拟化。要在 Windows 10 上打开 BIOS,您需要Shift在按下开始菜单中的重新启动按钮的同时按住 键来启动。然后你会看到一个带有一些选项的蓝屏。依次选择“疑难解答”、“高级选项”、“UEFI 固件设置”、“重新启动”。然后您的计算机将重新启动并直接打开BIOS。在旧版本的 Windows 上,正常关闭计算机,按住F2键,再次启动计算机,F2直到进入 BIOS 后才松开。在某些计算机上,您可能需要按住另一个键而不是F2。
现在您已进入 BIOS,您需要启用虚拟化。您应该更改哪个设置取决于您使用的计算机。即使在具有相同 Windows 版本的两台计算机之间,这也可能有所不同。在我的电脑上,您需要
Intel Virtual Technology
在Configuration
选项卡中设置为Enabled
。在其他计算机上,它可能在例如Security -> Virtualization
或在Advanced -> CPU Setup
. 如果您找不到这些选项中的任何一个,请在 Google 上搜索。不要随意更改 BIOS 中的任何内容,否则可能会导致计算机出现问题。启用虚拟化后,保存更改并退出 BIOS。这通常在选项卡中完成。enable virtualization (the kind of computer you have)
Exit
下载此文件(我上传了之前从链接下载的文件,但现在已损坏)。如果链接损坏,请发表评论让我知道,我会尝试将文件上传到其他地方。打开 7Z 文件的密码是
stackoverflow.com
. 这个 7Z 文件包含一个 VMDK 文件,它将充当 Mac 虚拟机的硬盘。提取该 VMDK 文件。如果磁盘空间对您来说是个问题,则在提取 VMDK 文件后,您可以删除 RAR 文件,从而节省 7GB。打开您在步骤 1 中安装的 VirtualBox。在工具栏中,按 New 按钮。然后为您的虚拟机选择一个名称(名称不重要,我称之为“Mac”)。在“类型”中,选择“Mac OS X”,在“版本”中选择“Mac OS X 10.11 El Capitan(64 位)”。
选择您的虚拟机可以使用的内存量。尝试平衡数量,因为太少的内存会导致虚拟机性能低下,而太多的内存会导致您的主机系统 (Windows) 耗尽内存,这将导致虚拟机和/或您的其他程序在 Windows 上重新运行会崩溃。在具有 4GB 可用内存的计算机上,2GB 是一个不错的数量。如果您选择了错误的数量,请不要担心,您可以随时更改它(虚拟机运行时除外)。
在硬盘步骤中,选择“使用现有的虚拟硬盘文件”,然后单击下拉列表右侧的小文件夹图标。这将打开一个浏览窗口。选择您在步骤 4 中下载并解压缩的 VMDK 文件。
完成此操作后,单击“创建”。
在窗口左侧的列表中选择虚拟机,然后单击工具栏中的设置按钮。在系统 -> 处理器中,选择 2 个 CPU。如果您后来意识到您在步骤 6 中选择了导致问题的内存量,您可以在系统 -> 主板中更改它。完成更改设置后,单击“确定”。
打开命令提示符 (
C:\Windows\System32\cmd.exe
)。在那里运行以下命令,替换"Your VM Name"
为您在步骤 5 中调用的虚拟机(例如"Mac"
)(保留引号):cd "C:\Program Files\Oracle\VirtualBox\" VBoxManage.exe modifyvm "Your VM Name" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 VBoxManage setextradata "Your VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" W1234567980
现在一切准备就绪,可以使用虚拟机了。在 VirtualBox 中,单击“开始”按钮并按照 Mac 的安装说明进行操作。在虚拟机上安装 Mac 后,您就可以像拥有真正的 Mac 一样开发 iOS 应用程序。
Remark: If you want to save space on your hard disk, you can compress the VMDK file that you extracted in step 4 and used in step 7. To do this, right click on it, select Properties, click on the Advanced... button on the bottom right, and check the checkbox "Compress contents to save disk space". This will make this very large file take less disk space without making anything work less well. I did it and it reduced the disk size of the VMDK file from 50GB to 40GB without losing any data.
备注:如果您想节省硬盘空间,您可以压缩您在步骤 4 中提取并在步骤 7 中使用的 VMDK 文件。为此,右键单击它,选择属性,单击高级...按钮,然后选中“压缩内容以节省磁盘空间”复选框。这将使这个非常大的文件占用更少的磁盘空间,而不会降低任何工作的效果。我做到了,它在不丢失任何数据的情况下将 VMDK 文件的磁盘大小从 50GB 减少到 40GB。
回答by Laurent
Some cloud solutions exist, such as macincloud(not free)
存在一些云解决方案,例如macincloud(非免费)
回答by Steffen Wenz
You can use Phonegap (Cordova) to develop iOS Apps without a Mac, but yout would still need a Mac to submit your application to the App Store. We developed a cloud application which also can publish your app without a Mac https://www.wenz.io/ApplicationLoader. Currently we are in beta and you can use the service for free.
您可以使用 Phonegap (Cordova) 在没有 Mac 的情况下开发 iOS 应用程序,但您仍然需要一台 Mac 才能将您的应用程序提交到 App Store。我们开发了一个云应用程序,它也可以在没有 Mac 的情况下发布您的应用程序https://www.wenz.io/ApplicationLoader。目前我们处于测试阶段,您可以免费使用该服务。
Best regards, Steffen Wenz
最好的问候,史蒂芬·温茨
(I'm the creator of the site)
(我是网站的创建者)
回答by Hemant Singh Rathore
Update Intel XDK is no longer available.
更新英特尔 XDK 不再可用。
You can use Intel XDKwith that you can develop and publish an app for iOS without the mac.
您可以使用英特尔 XDK开发和发布适用于 iOS 的应用程序,而无需使用 mac。
Click herefor detail.
单击此处了解详细信息。
回答by yannicuLar
Short answer : theoretically YES, but this has to be a VERY GOOD friend of yours, but again, you might prefer to buy a used mac-mini
简短回答:理论上是的,但这必须是您的好朋友,但同样,您可能更愿意购买二手 mac-mini
Long Answer : You will need this Mac for a really long time, depending on your app requirements, your development skills, and your Luck with Apple. for example:
长答案:您将需要这台 Mac 很长时间,这取决于您的应用程序要求、您的开发技能以及您在 Apple 的运气。例如:
- You might need some days to set up Xcode and the required SDKs and Libraries.
- It might take some time to get that Developer Account, sometimes you can wait too much even to get your request reviewed.
- When you submit your application for the first time, you will have to wait sometime, maybe up to several weeks, or even months, to get your app reviewed.
- Each time your app gets rejected, you will need to find and fix your issues (without much help from Apple, other that pointing out the guideline rule that you broke ), then re-apply your app for review, and wait again.
- Each time you try to apply a patch for your already deployed app, you will have to get your app reviewed and there is a chance that your previously legit app, now breaks a new guideline, so you re-apply and wait
- 您可能需要几天时间来设置 Xcode 以及所需的 SDK 和库。
- 获得该开发者帐户可能需要一些时间,有时您甚至可能需要等待太多时间才能审核您的请求。
- 当您第一次提交您的应用程序时,您将不得不等待一段时间,可能长达数周甚至数月,才能对您的应用程序进行审核。
- 每次您的应用被拒绝时,您都需要找到并解决您的问题(没有 Apple 的太多帮助,除了指出您违反的指导规则),然后重新申请您的应用以供审核,然后再等待。
- 每次尝试为已部署的应用程序应用补丁时,您都必须您的应用程序,并且您以前合法的应用程序现在有可能违反了新准则,因此您重新申请并等待
So, from my experience the development of an iOS app is a very lengthy procedure, without even considering the actual code-development time. Can you Borrow a Mac for that long ?
因此,根据我的经验,开发 iOS 应用程序是一个非常漫长的过程,甚至没有考虑实际的代码开发时间。你能借 Mac 这么久吗?
回答by Samuel Tulach
Also if you want to save some money you don't must buy a Mac. There is other ways how to do it:
此外,如果您想省钱,则不必购买 Mac。还有其他方法可以做到:
1.)You can use practically any OS to run latest MacOS in virtual machine (look at YouTube). I am using this method really long time without any problems on windows with VMWare.
1.)您几乎可以使用任何操作系统在虚拟机中运行最新的 MacOS(查看 YouTube)。我在使用 VMWare 的 Windows 上使用这种方法很长时间没有任何问题。
2.)Hackintosh. Install MacOS to your PC. You must have compatible components, but if you have, this is the best way, because you eliminate the lags in VM... I am using this in this time. Perfect. On my laptop, but please don't tell this to Apple, because practically this is illegal
2.)黑客。将 MacOS 安装到您的 PC。你必须有兼容的组件,但如果你有,这是最好的方法,因为你消除了 VM 中的延迟......这次我正在使用它。完美的。在我的笔记本电脑上,但请不要告诉 Apple,因为这实际上是非法的
3.)If you are making simple apps with minimum UI, you can use Theos. Also with Theos you can create cydia tweaks. Only one problem: codesign. If you want to publish app on App Store you still must have MacOS, but if you want to make app in home you can use CydiaImpactorto sign the apps with Apple ID.
3.)如果您正在制作具有最少 UI 的简单应用程序,则可以使用Theos。也可以使用 Theos 创建 cydia 调整。只有一个问题:协同设计。如果您想在 App Store 上发布应用程序,您仍然必须有 MacOS,但是如果您想在家制作应用程序,您可以使用CydiaImpactor使用 Apple ID 对应用程序进行签名。
I used all of this ways and all is working. By my VM is best solution if you don't want to spend lot of time by installing Hackintosh.
我使用了所有这些方法并且一切正常。如果您不想花费大量时间安装 Hackintosh,那么通过我的 VM 是最佳解决方案。
回答by Tempeck
You can use Smartface for developing your app with javascript and deploy to stores directly without a Mac. What they say is below.
您可以使用 Smartface 用 javascript 开发您的应用程序,并直接部署到商店,而无需 Mac。他们说的是下面。
With the Cloud Build module, Smartface removes all the hassle of application deployment. You don't need to worry about managing code signing certificates and having a Mac to sign your apps. Smartface Cloud can store all your iOS certificates and Android keystores in one place and signing and building is fully in the cloud. No matter which operating system you use, you can get store-ready (or enterprise distribution) binaries. Smartface frees you from the lock-in to Mac and allows you to use your favorite operating system for development.
借助 Cloud Build 模块,Smartface 消除了应用程序部署的所有麻烦。您无需担心管理代码签名证书和让 Mac 为您的应用程序签名。Smartface Cloud 可以将您所有的 iOS 证书和 Android 密钥库存储在一个地方,并且签名和构建完全在云中。无论您使用哪种操作系统,您都可以获得商店就绪(或企业分发)二进制文件。Smartface 让您摆脱了 Mac 的束缚,让您可以使用自己喜欢的操作系统进行开发。
回答by Valehelle
Most framework like React Native and Ionic allows you to built on their server. Meaning that they can help you compile and provide you with and .ipa file.
大多数框架(如 React Native 和 Ionic)都允许您在他们的服务器上进行构建。这意味着它们可以帮助您编译并为您提供 .ipa 文件。
The problem is you need Xcode or Application loader to submit your app to Apple App Store Connect. Both of these are only available on OSX. To overcome this solution you have 2 options that I am aware of
问题是您需要 Xcode 或 Application loader 才能将您的应用程序提交到 Apple App Store Connect。这两个都只在 OSX 上可用。为了克服这个解决方案,你有 2 个我知道的选项
- Rent mac virtually. http://www.macincloud.com
- Use website that helps you to upload your app (You need to have .ipa file). http://www.connectuploader.com
- 虚拟租用 mac。http://www.macincloud.com
- 使用可帮助您上传应用程序的网站(您需要有 .ipa 文件)。http://www.connectuploader.com