Finally, the retention capabilities of the robotic pill were tested using a real porcine intestine model, Figure 6e. A schematic of the robotic pill being docked in a section of the intestine by interaction with a magnetic field is demonstrated by Figure 6f. The robotic pill was small enough to travel through the intestine and be retained at specific locations, as illustrated by Figure 6g. The dynamic retention of the robotic pill using the porcine intestine model was also evaluated under constant fluid flow, where the intestine was connected to a mechanical pump and subjected to continuous fluid flow (Figure S7). The pill docked at the region next to the magnetic field for minimum half an hour of constant flow (7.2 liter per min). The pills were also capable of changing position under magnetic guidance, as shown in Figure 6h. We note that the robotic pill can deform the tissue while being dragged toward the permanent magnet, but it did not generate any tearing or leakage. The ability of the pill to dock at a specific location potentially provides a platform for long-term sampling inside the body.