Telegram-iOS
Find a file
Isaac 5962a563e4 feat: tgcalls CLI test tool with group SFU, video, and adaptation
Squashed buildout of the tgcalls testbench:

- CLI test tool with --mode p2p/reflector/group/group-churn,
  cross-version interop (--version, --version2), and quiet/summary output
- Linux toolchain + Docker multi-stage build, AWS Fargate mass test harness,
  local parallel mass test harness with signaling loss simulation
- SCTP writable gate, retransmission timer tuning, role-based handshake
- InstanceV2CompatImpl (PeerConnection backend with V2Impl signaling) and
  SignalingTranslator for v14.0.0 interop
- In-process Go/Pion SFU (ICE+DTLS+SRTP+SCTP per participant) with audio
  RTP forwarding, ActiveAudio/VideoSsrcs data channel broadcast, RTCP
  feedback path, and CGo c-archive integration
- GroupInstanceReferenceImpl (PeerConnection group-call) and mixed-impl
  group mode (--reference-participants), with SDP munging for simulcast
- H264 simulcast group video (FakeVideoTrackSource pattern generator,
  FakeVideoSink frame counting, --video flag, two-pass channel setup,
  reactive video setup from ActiveVideoSsrcs)
- Group churn stress mode (--mode group-churn, --churn-cycles)
- SFU stream-quality adaptation: BandwidthEstimator, LayerSelector
  state machine, RtxRingBuffer, simulcast SSRC rewrite
- Transport-cc feedback generation, NetworkSimulator (delay/jitter/loss/
  token-bucket bandwidth), --network-scenario step-down-up
- CLAUDE.md updates throughout

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 18:28:43 +02:00
.github Add CONTRIBUTING.md 2023-12-03 14:23:34 +04:00
.vscode Temp 2026-03-13 09:00:55 +01:00
build-system feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
buildbox Working state 2022-08-11 00:39:11 +04:00
docs feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
scripts Temp 2026-03-13 09:00:55 +01:00
submodules feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
Telegram Various improvements 2026-03-30 04:37:05 +02:00
Tests Temp 2026-03-13 09:00:55 +01:00
third-party feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
tools feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
.bazelrc feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
.cursorignore Build system 2025-05-05 17:58:19 +02:00
.gitattributes Various fixes 2021-02-11 22:51:56 +04:00
.gitignore Temp 2026-02-24 10:57:32 +01:00
.gitlab-ci.yml Fix 2026-01-17 02:36:00 +08:00
.gitmodules Update submodules 2026-02-23 11:17:26 +01:00
bazel-tgcalls-telegram feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
BUILD.bazel Temp 2026-03-13 09:00:55 +01:00
build_number_offset Fix chat title update 2026-02-10 10:52:53 +04:00
CLAUDE.md feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
Dockerfile feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
MODULE.bazel feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
MODULE.bazel.lock feat: tgcalls CLI test tool with group SFU, video, and adaptation 2026-04-30 18:28:43 +02:00
Random.txt Trigger build 2026-02-27 17:17:10 +04:00
README.md Update readme 2023-10-07 00:32:58 +04:00
versions.json Bump version 2026-03-07 02:43:53 +01:00
WORKSPACE Cleanup 2025-05-17 02:34:15 +08:00

Telegram iOS Source Code Compilation Guide

We welcome all developers to use our API and source code to create applications on our platform. There are several things we require from all developers for the moment.

Creating your Telegram Application

  1. Obtain your own api_id for your application.
  2. Please do not use the name Telegram for your app — or make sure your users understand that it is unofficial.
  3. Kindly do not use our standard logo (white paper plane in a blue circle) as your app's logo.
  4. Please study our security guidelines and take good care of your users' data and privacy.
  5. Please remember to publish your code too in order to comply with the licences.

Quick Compilation Guide

Get the Code

git clone --recursive -j8 https://github.com/TelegramMessenger/Telegram-iOS.git

Setup Xcode

Install Xcode (directly from https://developer.apple.com/download/applications or using the App Store).

Adjust Configuration

  1. Generate a random identifier:
openssl rand -hex 8
  1. Create a new Xcode project. Use Telegram as the Product Name. Use org.{identifier from step 1} as the Organization Identifier.
  2. Open Keychain Access and navigate to Certificates. Locate Apple Development: your@email.address (XXXXXXXXXX) and double tap the certificate. Under Details, locate Organizational Unit. This is the Team ID.
  3. Edit build-system/template_minimal_development_configuration.json. Use data from the previous steps.

Generate an Xcode project

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath=build-system/template_minimal_development_configuration.json \
    --xcodeManagedCodesigning

Advanced Compilation Guide

Xcode

  1. Copy and edit build-system/appstore-configuration.json.
  2. Copy build-system/fake-codesigning. Create and download provisioning profiles, using the profiles folder as a reference for the entitlements.
  3. Generate an Xcode project:
python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath=configuration_from_step_1.json \
    --codesigningInformationPath=directory_from_step_2

IPA

  1. Repeat the steps from the previous section. Use distribution provisioning profiles.
  2. Run:
python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    build \
    --configurationPath=...see previous section... \
    --codesigningInformationPath=...see previous section... \
    --buildNumber=100001 \
    --configuration=release_arm64

FAQ

Xcode is stuck at "build-request.json not updated yet"

Occasionally, you might observe the following message in your build log:

"/Users/xxx/Library/Developer/Xcode/DerivedData/Telegram-xxx/Build/Intermediates.noindex/XCBuildData/xxx.xcbuilddata/build-request.json" not updated yet, waiting...

Should this occur, simply cancel the ongoing build and initiate a new one.

Telegram_xcodeproj: no such package

Following a system restart, the auto-generated Xcode project might encounter a build failure accompanied by this error:

ERROR: Skipping '@rules_xcodeproj_generated//generator/Telegram/Telegram_xcodeproj:Telegram_xcodeproj': no such package '@rules_xcodeproj_generated//generator/Telegram/Telegram_xcodeproj': BUILD file not found in directory 'generator/Telegram/Telegram_xcodeproj' of external repository @rules_xcodeproj_generated. Add a BUILD file to a directory to mark it as a package.

If you encounter this issue, re-run the project generation steps in the README.

Tips

Codesigning is not required for simulator-only builds

Add --disableProvisioningProfiles:

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath=path-to-configuration.json \
    --codesigningInformationPath=path-to-provisioning-data \
    --disableProvisioningProfiles

Versions

Each release is built using a specific Xcode version (see versions.json). The helper script checks the versions of the installed software and reports an error if they don't match the ones specified in versions.json. It is possible to bypass these checks:

python3 build-system/Make/Make.py --overrideXcodeVersion build ... # Don't check the version of Xcode