Running a separate process/app in the host machine to serve my Xcode UITest

I’m trying to start a separate process/app in the host machine that will server my UITests. The instructions for these processes or apps require me to start them before my UITests starts. So, I added the script in the pre-action hook in the corresponding Scheme. it works on my machine both through Xcode and through a fresh install with Bitrise CLI.

It seems that through my build errors, the process or app is not running. I’ve searched through some discussions and it seems that it is indeed possible. I’m just wondering if there’s any kind of special setup for me to do to make it work?

One such suggestions is by using screen -dm the_command but I’m not sure where I should execute this command.

  1. Can you advise on how to go about running the separate process/app?
  2. Is there any documentation on what screen -dm the_command does?

Thank you.

Hi @jc.yu,

Thank you for reaching out.

This command is not made by Bitrise as it is a Unix-like command that comes on Mac and Linux. Looking at the man page:

-D -m This also starts screen in “detached” mode, but doesn’t fork a new process. The command exits if the session terminates.

This command runs the command you put after it in a silent state so you don’t see output and allows you to continue doing other things without waiting for it to finish.

You should put it before the other command that needs to use it in a script step.

Thank you for your response.

Okay on the -D -m. How about for my first question? The only reason why I entertained the screen -dm the_command which is something I just got from here

Without that command, a fresh clone of my project works with the Bitrise CLI in my local. However, that same script doesn’t seem to run in Bitrise. Here’s a link to the build

@non-binary – is the any documentation by Bitrise that can help us with running a separate process to serve the UI Tests? I’ve followed the documentation to see if there’s anything wrong with my setup, particularly running executing the workflow in my local via the Bitrise CLI.

Hi @jc.yu,

This is how you do that on Bitrise. There is not really another way to my knowledge.

Unfortunately there also isn’t documentation about this however I’m happy to answer any questions that you may have here.

What tool are you trying to run on another process?

I’m trying to use this library and it requires me to run an executable before my UI test starts. My tests fail because it expects this library to be running when they start. I’ve tried several approaches, 1.) adding them to the Pre-action of the scheme that runs my UI tests, 2.) adding a build phases script, and 3.) adding a step in my workflow to run this application. All three failed.

Unfortunately this is outside the scope of Bitrise support with that said - I would try finding the executable of this framework and starting it outside your app. Maybe that would work but like I said this is not something I can help with because it’s not directly related to Bitrise.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.