How it will work
- You get a cloud phone on your account.
- Allternit Desktop, signed in to that account, finds it within about 10 minutes and adds it under Settings → Computers → Phones, marked as a cloud phone.
- You run Phone Link setup on it once. This installs the Allternit Phone Link app, the same as on a phone you plug in.
- You sign in to the apps you want on the cloud phone, from its live screen.
For developers
Server. The cloud-api routes live under/api/v1/cloud-phones:
These routes accept a Clerk session, a
compute API token, or a Desktop device token. They return 503 unless CLOUD_PHONES_ENABLED=1 is set. A phone also needs a fleet host marked phones_enabled (migration 101_cloud_phones.sql). Each phone is a redroid container started by infrastructure/cloud-phone/run-phone.sh. Host setup is in infrastructure/cloud-phone/README.md.
Desktop bridge (window.allternit.phones and window.allternit.phoneLink):
phones.addByAddress(host, port?, label?)adds any phone that adb can reach athost:port(default port 5555) with no pairing step. It is reconnected on every poll. The result is{ ok: true, phone }or{ ok: false, error }.phones.cloudPhones()reads the account’s cloud phones and adds the running ones. The result is{ available: true, phones }, or{ available: false, reason }, wherereasonissigned_out,not_availableorerror.phoneLink.start({ platform: 'android', serial, linkHost })runs Phone Link setup on an added phone instead of waiting for a USB cable.serialis the phone’sserialfrom the phones list. For a cloud phone,linkHostis itslinkAddress.
via: 'address'. Cloud phones also list with kind: 'cloud'.
When Desktop adds a cloud phone that has no Phone Link yet, it starts Android setup on it by itself, with the same serial and linkHost. It never interrupts a setup that is already running. If setup doesn’t finish, Desktop tries again on later checks, waiting 10 minutes at first and doubling up to 6 hours, at most five times per app run.
Mesh access. The production Headscale policy only lets a device reach devices owned by the same customer, and a phone host is not owned by the customer. Each phone therefore needs one ACL rule: the owner’s mesh user to the host’s mesh IP on that phone’s adb and Phone Link ports, nothing else. GET /api/v1/cloud-phones/acl-fragment (admin only) lists these rules for every live phone. An operator merges them into infrastructure/mesh/headscale/policy.hujson and redeploys Headscale. Until then the phone is created but Desktop can’t reach it. The steps are in infrastructure/cloud-phone/README.md.