Channel Management
Manage deployment channels for your React Native app using the channel command.
What are Channels?
Channels allow you to maintain separate update streams for different environments or user groups. Common channels include:
- production - Updates for your end users
- staging - Updates for internal testing before production release
- beta - Updates for beta testers
- development - Updates for active development
Each channel has its own API key and independent deployment history.
Commands
Display Current Channel
Show the configured channel for iOS and Android:
silverbullet-ota channelExample output:
Current Channels:
iOS: production (from ios/MyApp/Info.plist)
Android: production (from android/app/src/main/res/values/strings.xml)Set Channel
Update the channel configuration for both platforms:
silverbullet-ota channel set <channel>Example:
silverbullet-ota channel set stagingOutput:
✓ Updated iOS channel to: staging
✓ Updated Android channel to: staging
⚠ You must rebuild your native app for changes to take effect!How Channels Work
Channels are configured in your native code and embedded at build time. This means:
- Build-time Configuration: Channel values are set when you build your app
- Runtime Behavior: The app checks for updates only from its configured channel
- No Hot-Switching: You cannot change channels without rebuilding the app
Native Configuration
iOS: Stored in Info.plist
<key>SILVERBULLET_OTA_CHANNEL</key>
<string>production</string>Android: Stored in strings.xml
<string name="silverbullet_ota_channel" moduleConfig="true">production</string>Usage Examples
Switch to Staging
# Set channel to staging
npx silverbullet-ota channel set staging
# Rebuild your app
npx react-native run-ios
npx react-native run-android
# Deploy to staging
npx silverbullet-ota deploy --platform ios --channel stagingCheck Current Channel
Before deploying, verify which channel your app is configured for:
npx silverbullet-ota channelPer-Platform Channels
You can manually configure different channels for iOS and Android by editing the native files directly:
For iOS: Edit ios/YourApp/Info.plist:
<key>SILVERBULLET_OTA_CHANNEL</key>
<string>beta</string>For Android: Edit android/app/src/main/res/values/strings.xml:
<string name="silverbullet_ota_channel" moduleConfig="true">staging</string>WARNING
Manual edits will be overwritten if you run channel set again. For persistent per-platform configurations, consider using build variants or schemes.
Channel Workflow Example
Development Workflow
# 1. Set to development channel
npx silverbullet-ota channel set development
# 2. Rebuild app
npx react-native run-ios
# 3. Make changes to your code
# ... edit files ...
# 4. Deploy to development channel
npx silverbullet-ota deploy --platform ios --channel development
# 5. Test the update
# ... restart app, verify changes ...Staging → Production Workflow
# 1. Deploy to staging first
npx silverbullet-ota deploy --platform ios --channel staging
# 2. Test on staging builds
# ... internal testing ...
# 3. If tests pass, deploy same bundle to production
npx silverbullet-ota deploy --platform ios --channel productionBuild Variants and Channels
For production apps, you might want different builds with different channels:
iOS with Schemes
Create different schemes (Debug, Staging, Release) and configure Info.plist per scheme:
- Duplicate your Info.plist for each scheme
- Set different
SILVERBULLET_OTA_CHANNELvalues - Configure your schemes to use the appropriate Info.plist
Android with Build Flavors
Use build flavors in android/app/build.gradle:
android {
flavorDimensions "environment"
productFlavors {
development {
dimension "environment"
resValue "string", "silverbullet_ota_channel", "development"
}
staging {
dimension "environment"
resValue "string", "silverbullet_ota_channel", "staging"
}
production {
dimension "environment"
resValue "string", "silverbullet_ota_channel", "production"
}
}
}Then build different variants:
./gradlew assembleDevelopmentDebug
./gradlew assembleStagingDebug
./gradlew assembleProductionRelease