Solving Advent of Code on your phone
You can solve Advent of Code in Python or JavaScript on an iPhone, iPad or Android phone with Deskless, a code editor, Git client and AI coding agent for mobile. Its Project Tools run your code on the device, with no computer, server or account, and they are free. Paste each day’s input into a file, keep the puzzle’s example as a test, and run: both answers print in the output.
Deskless needs iOS or iPadOS 26.0 or later, or Android 12 or later. Install it from the App Store or Google Play.
Set up a project
Create a new project in Deskless, for example advent-2026, and give each day its own folder: day01, day02 and so on. Each folder holds your solution, a test for the puzzle’s example, and your input.
To get the input, sign in to Advent of Code in your phone’s browser, open the day’s input page, select all and copy. In Deskless, create the input file in the day’s folder and paste.
Then open the project’s run settings:
- iPhone and iPad: Workspace layout → Project Tools → Configuration. Choose the runtime, type the entry path and the test file path, and tap Save .deskless/project.json, then Done.
- Android: Project Tools from the editor menu, then Project configuration. The settings are JSON; edit them and choose Save configuration.
Run prints your answers. Test runs the example tests. Both use your current files, unsaved edits included, so you don’t have to save between tries. Keep Deskless in the foreground while they run.
Python
Three files in day01: solve.py, test_solve.py and input.txt. Set the runtime to Python, the entry to day01/solve.py and the test file to day01/test_solve.py.
# day01/solve.py
from pathlib import Path
def parse(text):
return text.strip().splitlines()
def part1(text):
lines = parse(text)
return len(lines)
def part2(text):
lines = parse(text)
return 0
if __name__ == "__main__":
text = (Path(__file__).parent / "input.txt").read_text()
print("Part 1:", part1(text))
print("Part 2:", part2(text))
# day01/test_solve.py
import sys
import unittest
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from solve import part1, part2
EXAMPLE = """\
paste the example input from the puzzle here
"""
class Example(unittest.TestCase):
def test_part1(self):
self.assertEqual(part1(EXAMPLE), 1) # the example answer from the puzzle
def test_part2(self):
self.assertEqual(part2(EXAMPLE), 0)
Replace the placeholder bodies of part1 and part2 with your solution, and the expected values with the answers the puzzle gives for its example. On Android, the configuration looks like this:
{
"schemaVersion": 1,
"runtime": "python",
"entry": "day01/solve.py",
"arguments": [],
"tests": ["day01/test_solve.py"],
"previewRoot": "."
}
JavaScript
JavaScript in Project Tools has no file-reading API, so the input goes in a module instead of a text file. Four files in day01: input.js, solve.js, main.js and solve.test.js. Set the runtime to JavaScript, the entry to day01/main.js and the test file to day01/solve.test.js.
// day01/input.js
// Paste your puzzle input between the backticks.
export default String.raw`
paste your input here
`;
// day01/solve.js
function parse(text) {
return text.trim().split("\n");
}
export function part1(text) {
const lines = parse(text);
return lines.length;
}
export function part2(text) {
const lines = parse(text);
return 0;
}
// day01/main.js
import input from "./input.js";
import { part1, part2 } from "./solve.js";
console.log("Part 1:", part1(input));
console.log("Part 2:", part2(input));
// day01/solve.test.js
import { test } from "deskless:test";
import { equal } from "deskless:assert";
import { part1, part2 } from "./solve.js";
const example = String.raw`
paste the example input from the puzzle here
`;
test("part 1 example", () => equal(part1(example), 1)); // the example answer
test("part 2 example", () => equal(part2(example), 0));
String.raw keeps backslashes in the input as they are. If an input ever contains a backtick or ${, use the Python layout for that day. The same layout works in TypeScript: rename the files to .ts and choose the TypeScript runtime.
The next day
Duplicate day01 in the file browser, rename the copy day02, paste the new input and example, and change the entry and test paths in the configuration. When an answer is wrong, the debugger can help: add a breakpoint such as day02/solve.py:12 and step through. See Language Tools and Debugging.
If you keep your solutions in Git, add input.txt and input.js to a .gitignore. Advent of Code asks players not to publish their inputs or the puzzle text. Everyday Git in Deskless is free: commit, push and pull to GitHub, GitLab or any other host.
What it costs
- Free: the editor, Project Tools for Python, JavaScript and TypeScript, tests, the debugger, and everyday Git. Everything on this page works on the free plan.
- Deskless Pro ($3.99 a month, $24.99 a year or $69.99 once, US prices) adds conveniences such as multiple file tabs and Editor + Tools, which keeps the output beside your code instead of on its own screen.
Advent of Code asks people not to use AI to solve its puzzles, so this guide leaves Deskless’s AI features out.
Where it stops
Each run has a 15-second budget, and Python’s memory is capped at 256 MiB. Advent of Code says every puzzle has a solution that finishes within 15 seconds on ten-year-old hardware, but a brute-force attempt that would finish on a laptop may not finish here. Python runs in WebAssembly on the device, which is slower than Python on a computer.
Only the Python standard library is built in. Pure-Python packages from PyPI can be installed with Dependencies in Project Tools, which needs a connection once; packages with native code, such as NumPy, can’t. Deskless highlights Rust, Go, C and many other languages but doesn’t run them. On Android, Python depends on the System WebView; if Deskless reports that Python can’t start, update WebView or Android.
If you solve in another language, or want your usual tools, a laptop is the better place, or an SSH session to your own computer, which Deskless Pro includes. The Project Tools guide has the full limits.