Prerequisites
Before building for iOS, ensure you have:- macOS with Xcode installed (latest version recommended)
- Apple Developer Account (for device deployment)
- All build requirements installed
- Git with submodules initialized
Getting the Source Code
Configuring the Project
Set ROOT_BUNDLE_IDENTIFIER
Change
ROOT_BUNDLE_IDENTIFIER to something unique. This will be used for all bundle identifiers and app groups.app/iSH.xcconfig
The default value is
app.ish.iSH. You must change this to avoid conflicts with the official App Store build.Configure Development Team (Option 1: Xcode)
The easiest way to set your development team:
- Open
iSH.xcodeprojin Xcode - Select the project (not target) in the navigator
- Go to the Build Settings tab
- Search for “Development Team”
- Set your team ID in the project build settings
Building and Running
Select a target device or simulator
Choose your target from the scheme selector:
- iOS Simulator (for testing)
- Your connected iOS device (for device deployment)
Optional Configuration
Enabling Logging
To enable debug logging channels, editiSH.xcconfig:
app/iSH.xcconfig
- strace: Logs system call parameters and return values
- instr: Logs every instruction (very slow)
- verbose: General debug logs
Custom Root Filesystem
The default root filesystem URL is configured iniSH.xcconfig:
app/iSH.xcconfig
Project Structure
Key files in the iOS build:- iSH.xcodeproj: Main Xcode project file
- app/iSH.xcconfig: Main configuration file
- app/iOS.xcconfig: iOS-specific settings
- app/Project.xcconfig: Project-level settings
- app/App.xcconfig: App target settings
Troubleshooting
Code Signing Issues
Problem: “Failed to register bundle identifier” or code signing errors. Solution:- Ensure
ROOT_BUNDLE_IDENTIFIERis unique and doesn’t conflict with existing apps - Verify your Development Team is set correctly
- Check that your Apple Developer account has necessary permissions
- Try cleaning the build folder (Product > Clean Build Folder)
Missing Submodules
Problem: Build fails with missing files or “No such file or directory” errors. Solution:Build Script Failures
Problem: Xcode build scripts fail. Solution:- Ensure all build requirements are installed
- Check that
mesonandninjaare in your PATH - Look at the build log for specific errors
- Try cleaning the build folder and rebuilding
Simulator vs Device Builds
Problem: App works in simulator but not on device. Solution:- Ensure your device is registered with your Apple Developer account
- Check that provisioning profiles are correctly configured
- Some debugging features (like ptraceomatic) only work on specific platforms
Linking Errors
Problem: Undefined symbols or linking errors. Solution:- Make sure all dependencies in
deps/are properly initialized - Clean build folder and rebuild
- Check that you’re using a compatible Xcode version
- Verify Clang and LLD are properly installed
Development Workflow
Making Changes
- Make your code changes
- Build and run in Xcode
- Test in simulator or on device
- Check logs in Xcode Console
Debugging
- Use Xcode’s debugger with breakpoints
- Enable logging channels in
iSH.xcconfig - Check Console app for NSLog output
- Use Instruments for performance profiling
Testing Changes
For quick iteration:- Use the iOS Simulator for faster builds
- Enable relevant logging channels
- Test on physical device before release
Next Steps
- Build the CLI tool for faster testing
- Learn about debugging for troubleshooting
- Contribute to iSH