Sunday, 12 April 2020

Running the IOS Simulator on a codemagic build machine


In this article we will take a look at how to do a preliminary check on our apps by running them in an IOS simulator via codemagic. Codemagic allows us to connect to the build machine through SSH and VNC. Here we will take a look at connecting to codemagic's build machine using a VNC program

Tools Required

  • VNC viewer, which can be downloaded from here

Setup Codemagic

Complete the initial setup in codemagic (like specifying build and publish options) as usual. when you click on "Start new build" make sure you check on the "Enable remote access" checkbox and start the build process.

Connect to the Machine

After the process starts in a few seconds codemagic will display the SSH command as well as the details required to connect via VNC. Open up the VNC Viewer program downloaded earlier and in the field where it asks for "VNC server address" enter the ip address of the machine followed by the port number (for example, 192.xxx.xxx.xxx:18360, note the colon separating the ip and the port). And then click "connect to the host name option". It will show an insecure connection warning just click continue. Enter the username and password and click ok. And you will be able to see the desktop of the build machine.

Run the app in the simulator through Xcode

Use the Launchpad app to open Xcode (There will be multiple versions available, choose the one you used to build). Click on "open another project" and browse to the following location "/Users/builder/clone/ios" . Select the iPhone version for the simulator and click on the run button.

Limitation

  • The connection will be terminated 20 minutes after the build completes. So we should complete everything before the 20 minute window runs out. 


No comments:

Post a Comment

Setting GitHub hooks in Jenkins

While setting up a Freestyle project in Jenkins we may need to set Github webhooks in Jenkins so that Jenkins will get notified each time th...