  We develop and implement numerically a phase field model for the evolution
and detachment of a gas bubble resting on a solid substrate and surrounded by a
viscous liquid. The bubble has a static contact angle $\theta $ and will be
subject to gravitational forces. We compute, as a function of the static
contact angle, the cricital Bond number over which bubbles detach from the
substrate. Then, we perform similar studies for bubble resting on inclined
substrates and bubbles under the action of an external flow. We provide
approximate formulas for the critical Bond number under all these
circumstances. Our method is also able to resolve the pinchoff of the bubble
and the possible appearence of satellites.
