Note this is not a complete answer, but it is much too long and has too much maths for a comment.
The summary is that cooling a phone in space is very unlikely to be a problem (in particular the answers which claim that phones won't work in space for thermal reasons are almost certainly wrong), and conductive cooling (by attaching the phone to the structure of the satellite) would almost certainly be more than adequate. The key insight is that phones are low-power devices and work, on Earth, in cases, made of materials which are not notably good conductors of heat, and they do not fry in those cases.
Some general notes:
- convection does not work without the acceleration due to gravity, so an atmosphere does not help you much;
- A gas would conduct slightly, but not enough to be useful;
- A gas and a fan might be useful as this would allow forced cooling, but if you need to do that liquid cooling with a pump is probably far more practical;
- simply attaching the phone to the structure of the satellite would almost certainly be more than adequate.
Something which approaches the worst case
I considered an iPhone 8 (since this is the phone I have), and I took figures from here The key parameters that will matter are
- the battery is $6.96\,\mathrm{Wh}$;
- the phone's dimensions are $138\,\mathrm{mm}$ by $67.3\,\mathrm{mm}$ (thickness does not matter).
I will assume that we want the phone to run for $3\,\mathrm{h}$. This means that it needs to dissipate about $P = 2.32\,\mathrm{W}$. We are going to have the phone floating inside the spacecraft, not attached to it in any way, and there will be a vacuum in the spacecraft. We are willing to paint both the phone and the inside of the spacecraft suitably so that they both work as approximate black bodies. I will assume that the ambient temperature of the spacecraft is $T_A = 293\,\mathrm{K}$ (about $20^\circ\,\mathrm{C}$). The phone is assumed to radiate power (and to receive radiated power) through its front and back surfaces only (this is why I ignored the thickness of the phone: taking things into account makes things a little better).
The power radiated or received at a given temperature is then
$$P = \sigma T^4 \times 2xy\quad\text{$x,y$ height and width of phone}$$
The net power radiated by the phone is then
$$P_\text{net} = 2\sigma x y(T_P^4 - T_A^4)\quad\text{$T_P$ phone temperature}$$
and I am going to despicably change variable names and call this $P$ below, sorry. We can rearrange this expression to get
$$
\begin{aligned}
T_P &= \left(\frac{P}{2\sigma x y} + T_A^4\right)^{1/4}\\
\Delta T &= T_P - T_A\\
&=\left(\frac{P}{2\sigma x y} + T_A^4\right)^{1/4} - T_A
\end{aligned}
$$
OK, so we can plug numbers into this: with $T_A=293\,\mathrm{K}$ and $P = 2.32\,\mathrm{W}$, $T_P = 312\,\mathrm{K}$. This is about $38^\circ\,\mathrm{C}$: this is hot, but it's not catastrophically hot: it's just a little over human body temperature, for instance.
$\Delta T$ gets less as $T_A$ increases:

But in practice the phone will fry at some point when $T_A$ gets too high. I don't know what that point is, but I suspect phones are designed to survive in parked cars in direct sun in the summer, and that's a hostile environment. I have some distant background with military electronics, and one of the things people would tell you is that car electronics are tough in terms of temperature spec, and that in general COTS electronics is very often really robust: I think this is one of the insights that led people to experiment with phones in satellites.
Why this is not quite the worst case
First of all, I've assumed the phone is a black body. Well, we can paint it, but in real life it won't be, quite. But it can probably be made pretty close to a black body.
Perhaps I have underestimated the power dissipation? I don't know how much power it's possible to get a phone to use, unfortunately: I know that I can watch video on mine for at least a couple of hours and not worry about it dying, and that bounds the power dissipation to somewhere in this region.
Short-term higher-power dissipation is a problem that phones already need to deal with, so I believe this is not a problem.
So I believe that, although this is not quite the worst case it is close enough to it to show that the worst case is not that bad.
Dealing with the power in practice
Of course, no-one is going to fly a phone in a satellite by suspending it in the middle of the satellite and relying on radiative cooling. Instead it should be adequate to simply bolt the phone to some part of the structure of the satellite and allow it to cool by conduction as well as by radiation. Assuming the satellite itself can maintain a reasonable temperature, the increase in that temperature from another two or three watts of power is unlikely to hurt it (a cubesat is intercepting something like $14\,\mathrm{W}$ from the Sun, for instance).