- How To Make iOS Apps on Linux
- Eddy Chung
- Similar Posts
- Запуск ios on linux
- Installation
- Connecting to a device
- Usbmux daemon
- Pairing
- Transferring data
- Using a graphical file manager
- Manual mounting
- Importing videos and pictures
- HTML5 videos
- Troubleshooting
- ifuse fails to mount application directories
- Device cannot be redirected to a virtual machine
- See also
How To Make iOS Apps on Linux
So you love using a Linux machine but you want to develop iOS apps. It’s not super straight-forward since Xcode only runs on MacOS computers. I dug into this topic and will share with you how to do it yourself.
- Use a Virtual Machine to run a MacOS Environment
- Rent a Mac Online
- Dual Boot MacOS – Hackintosh Style
- Get started with an online Swift Sandbox
- Use third-party cross-platform solutions
- Buy a used or cheap MacOS computer
- In this article, I’ll break down these 6 options so you can decide what’s best for you.
Use a Virtual Machine to run a MacOS Environment
Virtual machines are created using software, this enables you to run a MacOS inside your Linux OS. There are a couple of different vendors that you can choose from:
I’d recommend VirtualBox, it’s used in many large tech companies and I’ve personally used it both for my own projects and professionally on the job. The installation process is super simple and getting it running MacOS is a breeze.
You’ll need to either find a MacOS image by searching for one online or by borrowing a friends laptop. Once you have that, you’ll be able to set up your virtual machine – adjusting settings such as hard drive space and memory to your liking.
Once you are inside your virtual machine, it should work almost exactly as if you owned a Mac. You’ll be able to install and run Xcode. Installing iPhone and iPad simulators will work as well. Sometimes the virtual ports may require minimal configuration in order for you to test on a real iOS device, however I have tried it and it works.
This is option is a great solution if you don’t mind a little bit of up front work to set it up. When it’s all been setup, its simple to turn on and off your MacOS when you need it for development!
Renting a Mac online is a hassle-free solution. Companies run a bunch of Macs in the cloud and charge users for access to them. Plans are usually very affordable and can range as low as $20/month.
- MacInCloud.com
- MacStadium.com
- VirtualMacOSX.com
- XCodeClub.com
- MacMiniVault.com
- Xcloud.me
One of the downsides of renting a Mac in the cloud is that you won’t be able to test on a physical iOS device. You’ll have to rely on using the simulator. However, when you’re ready to test out your application before releasing to the app store, you can always install Apple’s TestFlight software to see how your app looks on a real device.
A huge benefit of a cloud development environment is being able to access it from anywhere in the world. You can access it from a carribean island or anywhere else you have an internet connection. All your settings will be saved in the cloud.
Dual Boot MacOS, Hackintosh Style
You could also install MacOS on your Linux machine. This is called dual booting, where your machine has two operating systems that it can start up from. This requires some technical work and not all computer hardware will be compatible will MacOS.
Honestly, it’s quite a bit of effort to setup a hackintosh and its hard to keep it up to date. Hardware incompatibility is troublesome to debug and can take a lot of time.
If you’re looking just to build iOS apps, I recommend a different method. If you’re super interested in building custom computers though, this may be a good option for you!
Get started with an online Swift Sandbox Online swift sandboxes are a quick way to get started writing iOS code. There are a couple different options online:
These sandboxes allow you to get started immediately, no Xcode or any other installation of software is required.
You won’t be able to build a full iOS app from these online sandboxes, but you will be able to jumpstart your learning. This is a good option if you’re looking to get your feet wet in Swift code.
It’s also the easiest option and requires the least amount of work! Just click one of the links below and you can begin writing and compiling Swift code immediately.
Use third-party cross-platform solutions
Third party cross platform solutions have grown a lot recently. Larger companies have started to develop open source libraries to allow developers to code iOS and Android apps in different languages. Here are some of your options:
- PhoneGap
- Cordova
- Ionic
- Appcelerator
- React Native
- Flutter
- Xamarin
The hottest ones on the market right now are React Native and Flutter. React native is maintained by Facebook and Flutter is maintained by Google.
These libraries offer many benefits including coding in your favorite language and being able to learn both iOS and Android development at the same time.
However there are some draw backs. For most of these libraries, you still won’t be able to install on iOS device or simulator without a Mac machine. You can still develop the app and then later test it using Apple’s TestFlight. During development though you may just have to stick to the Android simulator. This will be similar, but the exact same as an iOS simulator.
These frameworks will also always be behind the native development path of using Xcode. This is because when Apple releases new features for iOS, they won’t make it onto this framework until weeks or even months later. It’s not an issue for most developers, but if you want to use the latest and greatest features when Apple releases them every year, you may want to look at a different solution.
Buy a used or cheap MacOS computer
This is the simplest solution. Buying a cheap MacOS computer will simplify your development greatly. This will eliminate an entire group of bugs from your development environment.
You can develop using almost any MacOS machine. Mac minis, which are Apple’s cheapest MacOS product, will work just fine. Even a Mac mini from a couple years back will work great.
Apple offers refurbished units on their website and you can also check eBay and other sites for deals too.
This will be a good investment if you’re looking to take iOS development as your career or as a serious hobby.
If I have about ~$200-300, I would just buy a refurbished or used Mac mini. This is simplest and will save me a lot of time.
If I am not sure about this whole iOS programming thing, I would rent a Mac from the cloud for a month to test it out. That way I can just cancel later on and just be out $20.
If I have no money at all, I would look into setting up a virtual machine on my Linux computer.
If I have no money at all and no computer, I would try it out in the Apple store. Apple employees don’t care how long you spend in the store, that’s the policy! Where theres a will theres a way 🙂 I’ve heard of people building entire apps from the iMacs at the Apple store.
If you liked this post and want to learn more, check out The Complete iOS Developer Bootcamp. Speed up your learning curve — hundreds of students have already joined. Thanks for reading!
Eddy Chung
Similar Posts
The Complete iOS App Development Bootcamp
Disclosure: This website may contain affiliate links, meaning when you click the links and make a purchase, we receive a commission.
On this page
Запуск ios on linux
iOS is an operating system created by Apple Inc. for use in the iPhone series of smartphones. Although connecting iOS devices to Linux is not supported by Apple, the libimobiledevice project provides libraries and tools to connect and transfer data between iOS devices and Linux machines.
Installation
Connecting to a device
Usbmux daemon
The libimobiledevice package depends on usbmuxd , which is responsible for performing the low-level connection to iOS devices. The usbmuxd package also includes an udev rule that automatically starts and stops the daemon whenever a device is connected or disconnected.
Connect the iOS device and verify that usbmuxd.service is automatically started.
$ systemctl status usbmuxd.service
. Active: active (running) since Sun 2020-01-19 19:23:18 UTC; 22s ago .
Pairing
After connecting your iOS device and unlocking the screen, you should be presented with a «Trust This Computer?» popup on the device. Tap «Trust», then enter your device passcode to complete the pairing process.
If you do not see the popup, you can start the pairing process manually. Connect the device, unlock the screen and run:
SUCCESS: Paired with device d8e8fca2dc0f896fd7cb4cb0031ba249
If you have multiple iOS devices connected —udid ios_udid parameter can be passed to target specific device.
You can verify the pairing has succeeded by running:
SUCCESS: Validated pairing with device 00008030-001D3562367A402E
Transferring data
After pairing, iOS exposes two different filesystems to the computer. One is the media filesystem, containing the device’s photos, videos and music. The second filesystem is used for sharing files directly to certain apps. This is sometimes called «iTunes document sharing». [1] [2]
Using a graphical file manager
File managers which use GVFS can interact with iOS devices. To access the media filesystem, install gvfs-gphoto2 . To access the app document filesystem, install gvfs-afc .
Note: When accessing the media filesystem, GVFS will only expose the device’s photos and videos, not music.
Dolphin support for iOS devices is included in the kio-extras package, which is already a dependency for Dolphin. [3]
Manual mounting
Install the ifuse package. You can then run the following command to mount your iPhone’s media filesystem:
You can use this to access the device’s photos inside mountpoint/DCIM .
Note: The device’s music database will also be accessible in mountpoint/iTunes_Control . You cannot add new songs to the device this way, but you can copy songs from the device to your computer.
Warning: Manually editing the databases inside iTunes_Control will result in their corruption, and turn your synced songs into stale data that can only be removed with a system restore.
To access an app’s document filesystem, first you need to identify the app:
"CFBundleIdentifier","CFBundleVersion","CFBundleDisplayName" "org.videolan.vlc-ios","432","VLC" "org.wikimedia.wikipedia","1932","Wikipedia" "org.kde.kdeconnect","2","KDE Connect" [. ]
You can then mount an application’s files using:
$ ifuse --documents APPID mountpoint
Where APPID is the bundle identifier of the desired application, such as org.videolan.vlc-ios .
After you’re done, unmount the filesystem:
$ fusermount -u mountpoint
Importing videos and pictures
Both videos and photos can be found in typically in /DCIM/100APPLE .
HTML5 videos
Typically you want to convert MOV files to a HTML5 video format like OGV using ffmpeg2theora . Note that the creation date metadata is not in the converted video, so you need to use a script like:
#!/usr/bin/sh find -name "*.MOV" | while read mov do d=$(gst-discoverer-1.0 -v $mov | awk '/datetime:/' | tr -d \") base=$ if test -f $base.ogv then touch -d$ $base.ogv ls -l $base.ogv else echo $base.ogv missing fi done
And use cp -a or rsync -t in order to preserve the file’s date & time.
Troubleshooting
ifuse fails to mount application directories
When using ifuse to mount application directories, you may run into the following error when trying to list the contents of the mountpoint:
".": Input/output error (os error 5)
This is a known issue that has been fixed in the current development version of libimobiledevice, but has not been released in a stable version yet. A workaround is to install libimobiledevice-git AUR .
Device cannot be redirected to a virtual machine
If you use a Windows virtual machine to sync your device via USB, trying to redirect it may fail with a «device is in use by another application» message. This is due to usbmuxd.service starting automatically when the device is connected. This can be solved by either stopping or masking usbmuxd.service .