RetroAchievements for Terraria require tModLoader, which you normally can't run on Android. I tried getting it to work with GameNative, but had no success.
But recently, I discovered this Android app that lets you run desktop .NET apps:
https://github.com/FireworkSky/RotatingartLauncher
The installation is pretty straightforward: you just specify the path to the GOG Linux version of Terraria and the path to a ZIP file containing tModLoader.
For mods, I downloaded them on my PC through Steam and simply copied the .tmod files to:
<Internal storage>/RALauncher/Terraria/tModLoader/Mods
For save files, I set up Syncthing to sync ~/.local/share/Terraria/tModLoader/ to: <Internal storage>/RALauncher/Terraria/tModLoader
By default, the game opens stretched at a much lower resolution, but going to Settings -> Video -> Fullscreen automatically sets the correct resolution.
To log in to RetroAchievements, I had to connect a keyboard to enter my username and password. While doing so, I noticed a small bug: connecting a keyboard while the game is running crashes it.
I haven't seen this app mentioned on Lemmy, so I hope someone finds this useful.
P.S. The handheld in the picture is an AYN Thor.
Things are getting really advanced when it comes to running Windows games on Android, to the point where people have gotten Steam running and are playing games like Silksong on their phones. Right now a lot of games crash and most 3D games don't run well, but chances are RimWorld could run fine on a higher end phone. Check out https://gamenative.app/ .