Simulating Success: How to Test iPhone Apps in Xcode Simulator with Sitecore 10.3 Docker Containers
Simulating Success: How to Test iPhone Apps in Xcode Simulator with Sitecore 10.3 Docker Containers
Introduction
When I was developing my iOS app, I encountered a problem: my Sitecore Docker container needed to be exposed. Instead of taking that route, I realized it would be simpler to use the Xcode simulator. This way, I could see my iOS application in action, using my Sitecore Docker container from another laptop.
Requirements
The requirements in order for this to work are the following:
- A PC with Sitecore Installed in a Docker Container
- A Mac with the iOS Application that is connected to the Sitecore Docker Container
- Make sure both the Mac and the PC are connected in the same network.
Procedure
If you have your Sitecore 10.3 Docker installed I suggest to run it until you can see your CMS. After that we will switch to our Apple computer where the iOS Application for your Sitecore Container app should be. If you want to know how you can connect your application to Sitecore via Sitecore Experience Edge you should try and see my previous post.
Once you ran your local sitecore instance copy the url, mine would be: https://www.headlessapp.localhost/ . Save this you will need it later.
In your PC open the CMD tool. You can do this by clicking windows home screen and search for CMD.
Right click on CMD and run it as Administrator.
Then in the command window type ipconfig
Once you press enter you should a lot of data being printed. Check IPv4 Address and copy that, you will need that later. Mine is 192.168.100.29
On the terminal type:
sudo nano /etc/hosts
You should see a file like this
Add an entry with the IP, followed by the URL you saved earlier.
Exit and save. Congratulations, you now have your Sitecore Docker instance connected from your PC to your Mac. To verify that it's working, simply navigate to that URL on your Mac. You should see the same page that appears when you access the URL on your PC.
Now, any iOS app that uses the same network configuration and the previously copied URL will be able to connect to your Sitecore Docker container, allowing you to conduct tests
Comments
Post a Comment