Skip to content

Instantly share code, notes, and snippets.

@Terrariadlc
Last active May 28, 2024 15:01
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 ??

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