Skip to content

Instantly share code, notes, and snippets.

@Terrariadlc
Last active November 4, 2024 13:30
Show Gist options
  • Save Terrariadlc/ddf5fc7e39da8a133d73b3111c1cb1b1 to your computer and use it in GitHub Desktop.
Save Terrariadlc/ddf5fc7e39da8a133d73b3111c1cb1b1 to your computer and use it in GitHub Desktop.
SWAP on Android using termux

Requirements: Termux, Root (preferably Magisk).

Open termux and give it root permissions

Type su to escalate the permissions

Now enter the command dd if=/dev/zero of=swapfile bs=1024 count=6144k replacing 6144k with as much swap as you need, in this case 6GB

Once its done, enter mkswap swapfile to create the sawp file and swapon swapfile to enable the swap file

@LeoRudra
Copy link

what about non-rooted phones ??

@DEV-197
Copy link

DEV-197 commented Oct 21, 2024

@LeoRudra You could use Shizuku with termux on non rooted devices

@FEMADOX
Copy link

FEMADOX commented Nov 4, 2024

How? I had already installed, what should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment