Build an iOS app without owning a mac?
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
1. iPhone/iPad (iOS) app development
So If you just want to develop iOS apps you don't want to pay anything,
You just need 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.
Now you just install Xcode and start developing iOS apps and test/debug with Simulator..
2. iPhone/iPad (iOS) app development and Publish to iTunes Store
for publishing your app on iTunes store you need to pay (example $99 / year) .
So For complete iOS Development Setup you need
- 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
Some cloud solutions exist, such as macincloud (not free)
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).
Here are some detailed steps for how install a Mac virtual machine on Windows:
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 Shift key 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 F2 key down, start your computer again and don't release F2 until 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 have no association with the person who uploaded it, but I've used it myself so I'm sure there are no viruses). 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 7Z 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 "macOS 10.13 High Sierra (64 bit)" (the Mac version you will install on the virtual machine is actually Catalina, but VirtualBox doesn't have that option yet and it works just fine if VirtualBox thinks it's High Sierra).
It's also a good idea (though not required) to move the VMDK file you extracted in step 4 to the folder listed under "Machine Folder" (in the screenshot above that would be
C:\Users\myname\VirtualBox VMs
).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 new window. In that new window, click on the "Add" button on the top left, which will open a browse window. Select the VMDK file that you downloaded and extracted in step 4, then click "Choose".
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; and in Network -> Attached to, select Bridged Adapter. 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" C02L280HFMR7
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.
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.
Update from 09/2017
It is possible to develop iOS (and Android at the same time) application using React Native + Expo without owning a mac. You will also be able to run your iOS application within iOS Expo app while developing it. (You can even publish it for other people to access, but it will only run within Expo app). Here is page from Expo on how to generate standalone app.
Steps from that page:
One: Install exp
by running npm install -g exp
Two: Configure app.json (somewhere along these lines):
{
"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
Four: run exp build:android
or 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.
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.
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-library issues, and other stuff.