Your iCloud photos, on Android.
Alba is free and open source, with optional donations. No subscriptions or paid features.
Still experimental. It uses unofficial Apple APIs, so things can break when Apple changes them. Not affiliated with Apple.
Android 11+. English and Italian. Android application ID: me.lvca.alba.
- Sign in to iCloud with two-factor authentication
- Browse your iCloud photos and the photos on your phone
- Watch videos and Live Photos
- Search by filename, caption, album, month or type; filter by date and sort your library
- Use albums, favorites, Hidden and Recently Deleted
- Create and join Shared Albums, invite people, add photos and comment
- Crop, rotate, adjust and filter photos, then save an edited copy
- Save originals offline or to your phone, and share them with other apps
- Upload JPEG, PNG, HEIC, still WebP and H.264/HEVC videos in MP4 or MOV files
- Back up photos and videos automatically from your camera and the folders you choose, including the ones already on your phone, over Wi-Fi or mobile data if you allow it. Each upload is checked in iCloud, and interrupted uploads retry on their own.
- Play Store release
- Free up space: remove backed-up photos and videos from the phone. It's built, but stays out of release builds until backup is proven on real accounts.
- Upload Live Photos with their video, RAW, AVIF and animated images
iCloud Shared Photo Library isn't supported. It's different from Shared Albums, which are supported.
Alba talks directly to Apple using the web APIs behind iCloud. Your photos don't pass through an Alba server.
It keeps a local catalog and downloaded previews on your phone, so you can still browse those when you're offline. Full-size originals are downloaded when you need them. You can also choose to keep them offline.
Your password and verification codes aren't saved. Your sign-in session is stored encrypted on your phone. See Privacy for the details, including optional crash reporting.
Run Gradle with JDK 21 (Android Studio's bundled JDK works) and Android SDK 37 with build tools 37.0.0. The build sets no Gradle Java toolchain: it compiles with the JDK that runs Gradle and targets Java 17 bytecode. Set JAVA_HOME and ANDROID_SDK_ROOT, then run:
./gradlew :app:assembleDebug testDebugUnitTest lintDebugAPKs are in app/build/outputs/apk/. :app:assembleRelease always produces an unsigned release. Official bundles are signed in an isolated GitHub Actions job; see RELEASING.md.
Shared Android settings (SDK levels, the Java 17 bytecode target, managed test devices) live in the convention plugins under build-logic/.
CI runs ktlint and detekt on every module:
./gradlew ktlintCheck detektktlint rules are configured in .editorconfig and detekt overrides in config/detekt/detekt.yml. The code is ktlint-clean; ./gradlew ktlintFormat fixes most findings. Detekt findings that predate the checks are recorded per module in detekt-baseline.xml, so only new findings fail the build. Fix old findings rather than adding new ones; after a deliberate cleanup, regenerate the baselines with:
./gradlew detektBaselineReports are written to <module>/build/reports/detekt/ and <module>/build/reports/ktlint/.
JavaScript tools use the Node 26 version pinned in .nvmrc. Run nvm install and nvm use from the repository root before using website, screenshot or release scripts. Script checks: node --test 'scripts/**/*.test.mjs'. Bun is used to install the website and screenshot packages from their lockfiles.
The website deploys from main. App versions are prepared in GitHub Actions, tested internally, then promoted without rebuilding. See release instructions.
Tests run at the lowest layer that can show the behaviour:
| Layer | Where | What belongs there |
|---|---|---|
| Plain JVM | */src/test |
Logic, state machines, gesture and layout maths, protocol and catalog code, and the fixture library (fixture-library). |
| Robolectric UI | app/src/test |
A screen or component rendered from fixed state with setAlbaContent / testAlbaActions: what it shows, what each control calls, dialogs, sheets and restoration. Whole-app journeys (navigation, the viewer's gestures, albums, shared albums) run the real app through AlbaAppRule, signed in to the fixture account with its library loaded before the test starts. |
| Screenshots | app/src/test/.../screenshots, images in app/build/screenshots |
How each distinct screen looks on a standard phone, plus the few whose layout changes on a compact phone, in a wide window or at font scales 1.3 and 2, and one of each kind of surface in dark theme (Roborazzi). A review aid, not a check: whether a screen is broken is checked by the UI checks in app/src/test/.../uichecks. |
| Device | */src/androidTest |
What only a device shows: video decoding, MediaStore and the system trash dialog, intents and link routing, WorkManager and jobs, the Keystore, locale changes, real system bars and rendering. |
Before you push, run the JVM layers and the checks. They take a few minutes with a warm Gradle daemon:
./gradlew testDebugUnitTest lintDebug detekt ktlintCheck :app:checkReleaseExcludesFixturesRun device tests only when your change touches device-only behaviour, and only the classes it affects. Create a native Android emulator in Android Studio, then pass the classes, comma-separated:
ALBA_AVD_NAME=your_avd scripts/run_android_tests.sh :app:connectedDebugAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=me.lvca.alba.app.viewer.ViewerTest,me.lvca.alba.app.albums.AlbumsTestAdd #methodName to a class to run one test, or pass -Pandroid.testInstrumentationRunnerArguments.annotation=me.lvca.alba.app.testing.Smoke for the smoke tests, a fast subset with one test per area of device-only behaviour. With no arguments, the script runs every suite. On a Mac, it requires and checks hardware graphics.
- Every pull request and push to
main: four jobs run side by side. "Build" builds every app, test and benchmark APK; "JVM tests" runs every JVM test; "Lint and static analysis" runs lint, detekt and ktlint; and "Android 36 device tests" runs every app, engine and protocol device test on a Pixel 9 emulator (API 36), split into four shards ("Android 36 device tests (1/4)" to "(4/4)"), each on its own runner. Each app test runs in exactly one shard, picked by AndroidJUnitRunner'snumShardsandshardIndexfrom the hash of its name; engine and protocol tests run on the last shard. The emulator's system image, device and boot snapshot are cached: pushes tomainsave them, and every run restores them. Gradle's build cache is on: pushes tomainsave it, and every run restores it, so tasks whose inputs did not change are not run again. Failed device tests are retried once; a test that passes only on the retry is listed as flaky in the job summary. Fix it at the root. Pull requests also get the "Screenshot report" (below), which never fails. - Nightly: the build, JVM test and lint jobs and the
@Smokedevice tests on API 30 (the minimum) and on a compact phone. Manual runs do both and the full Pixel 9 suite.
"Android checks" passes only when every one of those jobs passes; the screenshot report is not one of them.
A device test that does not need a device is in the wrong layer. Mark a new device test @Smoke when it is the quickest check of an area of device-only behaviour; CI runs every device test on pull requests either way.
The screenshot tests render each screen to app/build/screenshots/<variant>/<name>.png on every run; nothing compares them. On a pull request, CI's "Screenshot report" job renders them on the pull request (merged into its base) and on the base, compares them by pixels and comments once on the pull request, updating that comment on every push, with a before and after table of the screens that changed and lists of the new and removed ones. It never fails because a screen changed, and "Android checks" does not wait for it.
The comment's images live on the ci-screenshots branch, under pr-<number>/<commit>/: one commit that CI rewrites on each report, keeping only open pull requests' latest images. Forks and Dependabot get the report in the job summary instead, with the images in the run's screenshot-report artifact.
To look at the images locally, run ./gradlew :app:testDebugUnitTest --tests 'me.lvca.alba.app.screenshots.*'. Text renders differently on macOS than on Linux, where CI renders.
Store artwork stays a device capture, because it should show real hardware rendering of the fixture library's photos. Tests that capture it carry @ScreenshotCapture and run only when asked for:
ALBA_AVD_NAME=your_avd scripts/run_android_tests.sh :app:connectedDebugAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.annotation=me.lvca.alba.app.testing.ScreenshotCapture \
-Pandroid.testInstrumentationRunnerArguments.class=me.lvca.alba.app.viewer.ViewerTestThe full steps are in the screenshot tool.
For performance work, set ANDROID_SERIAL to your test device. Run scripts/benchmark_android.sh profile to update the Baseline Profile, then scripts/benchmark_android.sh measure on a physical phone. These use a separate app signed in to the fixture account, whose library never reaches Apple.
Alba relies on iCloud.com's private web protocol, so Apple can change something under it at any time. Two tools help.
The app reads status/protocol-status.json from main, through https://raw.githubusercontent.com/thisislvca/alba/main/status/protocol-status.json. Committing to that file is the switch: no server, secret or release is needed. To pause uploads for every version up to 0.4.2:
{
"schemaVersion": 1,
"pauses": [
{
"id": "2026-11-upload-change",
"areas": ["uploads"],
"versions": { "max": "0.4.2" },
"message": {
"en": "Backup is paused while we update Alba for an iCloud change.",
"it": "Il backup è in pausa mentre aggiorniamo Alba per una modifica di iCloud."
}
}
]
}areas:uploads(backup and photos the user uploads),library-edits(favorites, albums, Hidden, Recently Deleted),shared-albums(every Shared Album change), orall. Reads, browsing and verification are never paused.versions: optionalminandmax, both inclusive, asx.y.zorx.y.z-pre. Leave it out to cover every version. As in Semantic Versioning, a pre-release comes before its release: 0.5.0-rc1 and debug builds' 0.5.0-dev are below 0.5.0, so"max": "0.5.0"covers them and"min": "0.5.0"doesn't.message: optional, a string or text by language. Without one, the app shows its own wording.- To lift a pause, remove its entry (leave
"pauses": []).
Phones ignore a document that doesn't parse: they keep their last good copy for up to 12 hours, then pause nothing. A broken edit can therefore neither pause nor lift anything, and it can quietly let a pause lapse. ProtocolStatusDocumentTest checks the committed file, but CI only runs on pull requests and pushes, after the file is already live on main. Flip it through a pull request and merge once CI is green. If you must push straight to main, first run ./gradlew :protocol-icloud-web:testDebugUnitTest --tests '*ProtocolStatusDocumentTest' locally.
While uploads are paused, queued items stay pending, nothing is sent or marked failed, and backup continues on its next pass once the pause clears. Uploads the user started wait in the queue and continue the next time Alba schedules them, such as when the app opens. Paused edits are refused with a message and change nothing.
How it behaves on phones: the request is a plain GET with no cookies, account or device identifiers. The file is fetched only when Alba is about to write and its copy is stale: a clear status is kept 30 minutes, a pause 10, and GitHub's CDN may add about 5 more. It fails open: if the file can't be fetched, the last good copy is used for up to 12 hours and then nothing is paused; a file that doesn't parse is ignored. Builds made with -PalbaProtocolStatusUrl= (empty) never pause, and forks can point that property at their own copy.
LiveContractTest checks, read-only and against a real account, the assumptions the protocol code makes: that the session validates, the web services Alba uses are listed, the PrimarySync zone and its record types and fields are there and parse, and that change tokens, lookups, previews, albums, Hidden, Recently Deleted, the upload verification read, storage, profile and Shared Albums still work. Each check names its assumption, so a failure says which one broke. It never writes. Upload URL reservation is not checked, because it reserves space on Apple's side; only the upload service's URL is.
It is never part of testDebugUnitTest or CI's normal jobs. To run it, preferably with a test Apple Account:
./gradlew :protocol-icloud-web:liveSignIn --console=plain # once: signs in and writes .live/icloud-session.json
./gradlew :protocol-icloud-web:liveContractTestThe password is read without echo and never saved. The session file is ignored by git and readable only by you; ALBA_LIVE_SESSION_FILE puts it elsewhere. Without a session the test is skipped. Sessions expire, so run liveSignIn again when validation fails.
When Apple renews the session during a run, the new tokens are saved back to the session file. With ALBA_LIVE_SESSION, they are saved only if ALBA_LIVE_SESSION_FILE is also set; otherwise the report ends with a note that the session was renewed and the variable still holds the older tokens.
To run it in GitHub Actions, add the repository secret ALBA_LIVE_SESSION with base64 < .live/icloud-session.json, then start Actions > Live iCloud contract > Run workflow. Without the secret the workflow does nothing. CI can't save renewed tokens (they would have to be printed), so when the report notes a renewal, or session.validate starts failing, run liveSignIn locally and update the secret. Apple may treat sign-ins from GitHub's data centres with suspicion, so the local run is the main path.
Found a bug or have an idea? Open an issue. Pull requests are welcome too, under the same AGPL-3.0-only license.
Please leave passwords, account data and personal photos out of reports. For security problems, use private reporting.
