DEV Community

Cover image for How to emulate iOS on Linux with Docker

How to emulate iOS on Linux with Docker

Iaan Mesquita on December 29, 2021

After several unsuccessful attempts, I was finally able to virtualize a macOS to run tests on an iOS app I was working on. But before proceeding, ...
Collapse
 
hassanemam profile image
Hassan Emam

How do you re open the MacOS emulator after you restart the Ubuntu system. I cannot find the Docker image

Collapse
 
ianito profile image
Iaan Mesquita

In terminal:

docker ps -a

To know what is container id of our container and next we'll start typing the command below:

docker start ID

and then select the macOS option

Collapse
 
__4d610535a9 profile image
محمدباقر ملایی • Edited

after a day
i couldnt run it

alsa: Could not initialize ADC
alsa: Failed to open default':
alsa: Reason: No such file or directory
audio: Could not create a backend for voice
adc'
gtk initialization failed

Collapse
 
ahmedhosnyabdelhameed profile image
Ahmed Hosny

just remove audio device from the docker run command,

most of the time, you will not use audio on the mac, remove -e AUDIO_DRIVER=alsa
or you can use pulseaudio

it works for me

Collapse
 
ianito profile image
Iaan Mesquita

Nice.

Thank you!

Collapse
 
stranger777 profile image
Ivan Novikov • Edited

Unfortunately, it's illegal without any Mac computer. Even a testing iOS with Xamarin and Visual Studio suggests that you have any real Apple computer. And we can use a simulator (not emulator) docs.microsoft.com/en-us/xamarin/i...

Collapse
 
dreamingcodes profile image
Lorenzo Rizzotti

Well, that's what Apple would like... In reality, they can't do anything about it.
Here are some sources for more information:

  1. Court Document
  2. Washington Post Article
Collapse
 
sergiycheck profile image
Serhii

Installation of mac os is lost after stopping the container

Collapse
 
ianito profile image
Iaan Mesquita

Really? When you start the container, some options will appears then just select option macOS and your system will be booted, and by default, all changes made in the container aren't lost.

Collapse
 
sergiycheck profile image
Serhii

I needed a higher version of mac os so I started the upgrade process afterwards download finished but stuck without change. I made a shut down, started container again and update was missing. Maybe I was doing something wrong. I will try again and leave a feedback.

Thread Thread
 
ianito profile image
Iaan Mesquita

I don't think updating directly will work.

Have you checked if the version that you need is listed on repo? github.com/sickcodes/Docker-OSX

There are the docker images with the corresponding mac version.

Thread Thread
 
sergiycheck profile image
Serhii

I wonder if there is a version that supports x-code. Maybe it's ventura but there is not mentioned the version of it

Thread Thread
 
ahmedhosnyabdelhameed profile image
Ahmed Hosny
Collapse
 
jkaltes profile image
Jaap Korthals Altes

Installation and boot were effective, I installed brew, but thereafter I didn't come further in the big-sur image.
I the following problems:
• xcode needed a higher version of MacOS according to Apple store;
• I tried to update and thereafter it didn't boot anymore;
• I tried also Venture from github.com/sickcodes/Docker-OSX, but it failed somewhere in the install.
• Montery installed, but the screen setting is wrong so that the lower part is not displayed. At the bottom of the screen I can only see the top half of the icons.
• I received the following message again and again "This Apple ID has not yet been used with the App Store. Please review your account information.". After rebooting the emulator and going through some confirmations and this same error message 10 times more at last it worked somehow and I could install apps from Apple Store also xCode;
• But running the IOS emulator gave the message that 4GB was not enough. Changing this, is every easy using virtmanager, vmware or vitualBox. This is also possible now, because it is possible with qemu. github.com/sickcodes/Docker-OSX/di... tells how: editing Lauch.sh works, docker update not. Changing -vga vmware in -vga std also made that the whole MacOS screen was visible.
• Now the IOS simulator worked under the MacOS emulator.

Collapse
 
ahmedhosnyabdelhameed profile image
Ahmed Hosny
Collapse
 
cajuuh profile image
Pedro Alcântara

i had to update the OS version to download xcode

Collapse
 
prabhattopi profile image
Prabhat Singh

i am getting permission denied error after connecting from linux to mac could you help me please i am getting binary folder
thanks

Collapse
 
mneto12 profile image
Miguel Coronel Rivas

I think the docker hub repository is lost
hub.docker.com/r/sickcodes/docker-osx

Collapse
 
micha_betowski_72653f470 profile image
Michał Betowski

Hi.

  1. can I install Linux Mint on a Flash Drive and follow the same commands as you give for Linux Manjaro?

  2. is it possible to set macOS to start automatically when I boot?