Acoustic cavitation bubbles are considered to be generated due to heterogeneous nucleation because a smaller amount of energy is required in this case compared with homogeneous nucleation. A typical example of such nucleation sites is tiny cracks filled with gas, commonly termed as "gas pocket."Such microcracks can exist in abundance on the surface of reactor walls or sonotrodes used for the cavitation treatment. Eventually, the heterogeneously nucleated cavitation bubble is detached from the solid surface; however, the detachment mechanism has been unclear so far. Therefore, the present study numerically investigated the dynamic behavior of the cavitation bubble originated from the heterogeneous nucleation at wall cracks. During propagation of an ultrasound wave through a liquid, gas pockets in cracks oscillate sinusoidally when the sound pressure amplitude and crack radius are small. In this case, the bubble cannot detach from the surface. On the other hand, as the sound pressure amplitude, crack size, and/or contact angle become larger, the bubble begins to oscillate non-linearly that causes liquid jetting. The liquid jetting can cause the bubble detachment from the surface due to the interaction between the liquid jet and the bottom wall. Stronger liquid jetting makes many small detached bubbles.