Install via CLI (pip)
Install Shield iOS via pip. Works on macOS and Linux.
Requirements
- Python 3.9 or later
- macOS (recommended) or Linux
- Active ByteHide subscription
Install
pip install bytehide-shield-iospip install bytehide-shield-iosVerify the installation:
shield-ios versionshield-ios versionQuick Start
1. Initialize configuration
shield-ios initshield-ios initThis creates a shield-ios.json file in the current directory.
2. Add your project token
Edit shield-ios.json and add your ByteHide project token:
{
"projectToken": "bh_YOUR_PROJECT_TOKEN_HERE",
"protections": {
"anti_debug": true,
"string_encryption": true,
"control_flow": "medium"
}
}{
"projectToken": "bh_YOUR_PROJECT_TOKEN_HERE",
"protections": {
"anti_debug": true,
"string_encryption": true,
"control_flow": "medium"
}
}Get your token from the ByteHide dashboard.
3. Protect your app
# Protect an IPA
shield-ios protect MyApp.ipa --config shield-ios.json
# Protect an xcarchive
shield-ios protect MyApp.xcarchive --config shield-ios.json --no-sign# Protect an IPA
shield-ios protect MyApp.ipa --config shield-ios.json
# Protect an xcarchive
shield-ios protect MyApp.xcarchive --config shield-ios.json --no-signOutput: MyApp_protected.ipa
CLI Reference
shield-ios protect <input> [options]
shield-ios init
shield-ios versionshield-ios protect <input> [options]
shield-ios init
shield-ios versionOptions
| Option | Description |
|---|---|
--config <path> | Path to configuration file |
--output <path> | Custom output path |
--no-sign | Skip code signing |
--verbose | Verbose output |
Input Formats
Shield iOS supports two input formats:
| Format | Description | When to Use |
|---|---|---|
.ipa | Standard iOS application archive | Direct IPA protection and re-signing |
.xcarchive | Xcode Archive (from Product > Archive) | Post-archive protection with --no-sign (Xcode handles signing during distribution) |
Examples
# Protect an IPA
shield-ios protect MyApp.ipa --config shield-ios.json
# Protect an xcarchive (in-place, no re-signing)
shield-ios protect MyApp.xcarchive -o MyApp.xcarchive --config shield-ios.json --no-sign
# Custom output path
shield-ios protect MyApp.ipa --output builds/MyApp_secure.ipa --config shield-ios.json
# Verbose mode
shield-ios protect MyApp.ipa --config shield-ios.json --verbose# Protect an IPA
shield-ios protect MyApp.ipa --config shield-ios.json
# Protect an xcarchive (in-place, no re-signing)
shield-ios protect MyApp.xcarchive -o MyApp.xcarchive --config shield-ios.json --no-sign
# Custom output path
shield-ios protect MyApp.ipa --output builds/MyApp_secure.ipa --config shield-ios.json
# Verbose mode
shield-ios protect MyApp.ipa --config shield-ios.json --verboseConfiguration Examples
Minimal (development)
{
"projectToken": "bh_YOUR_TOKEN",
"protections": {
"anti_debug": true,
"string_encryption": true
}
}{
"projectToken": "bh_YOUR_TOKEN",
"protections": {
"anti_debug": true,
"string_encryption": true
}
}Recommended (production)
{
"projectToken": "bh_YOUR_TOKEN",
"protections": {
"anti_debug": true,
"anti_jailbreak": true,
"string_encryption": true,
"symbol_renaming": true,
"control_flow": "medium",
"opaque_predicates": "medium"
}
}{
"projectToken": "bh_YOUR_TOKEN",
"protections": {
"anti_debug": true,
"anti_jailbreak": true,
"string_encryption": true,
"symbol_renaming": true,
"control_flow": "medium",
"opaque_predicates": "medium"
}
}Maximum (high-security)
{
"projectToken": "bh_YOUR_TOKEN",
"protections": {
"anti_debug": true,
"anti_jailbreak": {
"enabled": true,
"sensitivity": 2,
"exit_on_detect": true
},
"string_encryption": true,
"symbol_renaming": true,
"swift_stripping": true,
"control_flow": "aggressive",
"dead_code_injection": "heavy",
"opaque_predicates": "complex",
"class_encryption": true,
"resource_encryption": true,
"rasp": {
"enabled": true,
"hook_detection": true,
"trace_detection": true,
"tamper_detection": true,
"action": "exit"
}
}
}{
"projectToken": "bh_YOUR_TOKEN",
"protections": {
"anti_debug": true,
"anti_jailbreak": {
"enabled": true,
"sensitivity": 2,
"exit_on_detect": true
},
"string_encryption": true,
"symbol_renaming": true,
"swift_stripping": true,
"control_flow": "aggressive",
"dead_code_injection": "heavy",
"opaque_predicates": "complex",
"class_encryption": true,
"resource_encryption": true,
"rasp": {
"enabled": true,
"hook_detection": true,
"trace_detection": true,
"tamper_detection": true,
"action": "exit"
}
}
}Code Signing
Shield can re-sign your app after protection:
{
"code_signing": {
"identity": "Apple Development",
"provisioning_profile": "/path/to/profile.mobileprovision",
"skip_if_not_macos": true
}
}{
"code_signing": {
"identity": "Apple Development",
"provisioning_profile": "/path/to/profile.mobileprovision",
"skip_if_not_macos": true
}
}Or skip signing with --no-sign and let Xcode/Fastlane handle it.
Updating
pip install --upgrade bytehide-shield-iospip install --upgrade bytehide-shield-iosVirtual Environments
For isolated installations:
python3 -m venv shield-env
source shield-env/bin/activate
pip install bytehide-shield-iospython3 -m venv shield-env
source shield-env/bin/activate
pip install bytehide-shield-iosTroubleshooting
"shield-ios: command not found"
The pip scripts directory is not in your PATH. Try:
python -m shield_ios.shield protect MyApp.ipa --config shield-ios.jsonpython -m shield_ios.shield protect MyApp.ipa --config shield-ios.jsonOr add the pip bin directory to your PATH:
export PATH="$HOME/.local/bin:$PATH"export PATH="$HOME/.local/bin:$PATH""No project token configured"
Add a valid projectToken to your shield-ios.json. Get one from cloud.bytehide.com/product/shield.
"Cloud validation failed"
Your token may be invalid or expired. Check your ByteHide dashboard.
Next Steps
Xcode Integration
Protect automatically on Archive
Configuration Reference
Full configuration options
Homebrew Installation
Install via Homebrew on macOS