Ingestible devices have become a popular means for diagnosing and treating the gastrointestinal (GI) tract due to their noninvasive nature. However, their residency period in the GI tract is limited by the transit time through it. In previous work, we designed a tissue attachment mechanism (TAM) inspired by parasitic worms' attachment methods, which were tested for implanting biosensors or drug delivery payloads to the small intestine with a swallowable capsule robot. In that work, the attachment success rate was 91.7%, and the average attachment duration of the TAM was 32.2 hours after factorial optimization of major design factors. This work develops a novel nitinol TAM (NTAM) for improving the attachment duration using the shape-changing properties of nitinol. The attachment strength of the NTAM to the intestinal tissue was assessed ex vivo and in vivo. The attachment duration of the NTAMs in live porcine models was evaluated from radiographic images, and histological analysis of the attachment location of an NTAM was performed after euthanasia. The NTAM was 100% successful in an attachment strength study and achieved a maximum attachment duration of 13 days, while the average attachment duration was 85.63±77.83 hours. Histological analysis did not report any permanent damage to the tissue. This work shows a 2.7-fold improvement in attachment duration over the previous design. This work has demonstrated a method of prolonged attachment to the intestinal wall through a swallowable device, which can be used for long-term drug delivery or biosensing.