Tweego on Android

I’m not sure who’s aware of it (I certainly wasn’t), but the tweego compiler actually works just fine on Android. I’ve been able to write and compile Twine games right on my phone using a text editor and tweego on the command line.

  • Grab Termuxfrom the Play store. It’s a Linux terminal for Android (since Android is just a flavor of Linux). It doesn’t require root or anything.

  • To install tweego, just type the command pkg install tweego into termux. This will download and install tweego. It will now be added to Android’s search path so you can execute the tweego command from anywhere.

  • Next you’ll need a copy of the storyformats folder. Go grab one of the tweego releases from the official site. It doesn’t matter which since we only want the storyformats folder. Extract it and copy the storyformats folder to your project directory. If your device doesn’t have a zip extractor app, you can install Rar, the official Android port of Rar/Winrar on desktop, which also does zip archives.

  • Now navigate to your project folder in Termux. For those not familiar with navigating directories from the command line:

    • ls lists the contents of the directory. Subdirectories will be listed in a purplish color.
    • cd <directory> changes to that directory.
    • cd .. backs out one directory.
  • That’s it. You should now be able to compile your game with something like tweego story.tw -o story.html.

Edit: Lots of edits thanks to @SpaceHobo 's help!

2 Likes

I have some very good news for you: you can skip absolutely every step between installing termux and running pkg install tweego!

The pkg command downloads and installs the software package from the termux repositories, where someone has been kind enough to re-build termux from source. This is important because your android device is almost guaranteed to be ARM, as opposed to x86 or amd64, so those packages can’t run without some sort of emulation layer anyway. You can delete the zipfile and the un-zipped folder you expanded.

This is really cool, and I hadn’t noticed this was supported until reading your post, so thanks for the notice.

1 Like

Oh! Haha. :smile: I told you my Linux-fu was weak. I didn’t realize pkg was grabbing it from a repository. Oops.

I believe you still need to grab the zip file to get the storyformats folder. I would think the pkg package would include it, but it doesn’t seem to be on my path. Do you know a way around that?

1 Like

Yes, you’re correct that you need to put storyformats in your working directory somehow. I tend to grab the format.js files and drop them in by hand anyway, so that I can keep to a single release rather than tracking what’s in the package.