Untethered electrical stimulation or pacing of the heart is of critical importance in addressing the pressing needs of cardiovascular diseases in both clinical therapies and fundamental studies. Among various stimulation methods, light illumination-induced electrical stimulation via photoelectric effect without any genetic modifications to beating cells/tissues or whole heart has profound benefits. However, a critical bottleneck lies in the lack of a suitable material with tissue-like mechanical softness and deformability and sufficient optoelectronic performances toward effective stimulation. Here, we introduce an ultrathin (<500 nm), stretchy, and self-adhesive rubbery bio-optoelectronic stimulator (RBOES) in a bilayer construct of a rubbery semiconducting nanofilm and a transparent, stretchable gold nanomesh conductor. The RBOES could maintain its optoelectronic performance when it was stretched by 20%. The RBOES was validated to effectively accelerate the beating of the human induced pluripotent stem cell-derived cardiomyocytes. Furthermore, acceleration of ex vivo perfused rat hearts by optoelectronic stimulation with the self-adhered RBOES was achieved with repetitive pulsed light illumination.