AppleDev.FbIdb 0.8.10

dotnet add package AppleDev.FbIdb --version 0.8.10
                    
NuGet\Install-Package AppleDev.FbIdb -Version 0.8.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AppleDev.FbIdb" Version="0.8.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AppleDev.FbIdb" Version="0.8.10" />
                    
Directory.Packages.props
<PackageReference Include="AppleDev.FbIdb" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AppleDev.FbIdb --version 0.8.10
                    
#r "nuget: AppleDev.FbIdb, 0.8.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AppleDev.FbIdb@0.8.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AppleDev.FbIdb&version=0.8.10
                    
Install as a Cake Addin
#tool nuget:?package=AppleDev.FbIdb&version=0.8.10
                    
Install as a Cake Tool

AppleDev.FbIdb

A C# client library for Facebook's IDB (iOS Development Bridge) companion, providing a full .NET API for controlling iOS simulators and devices.

Features

  • Complete gRPC API Coverage: Wraps all IDB companion gRPC methods
  • Companion Process Management: Automatically manages the idb_companion process lifecycle
  • Flexible Binary Location: Supports bundled binary, Homebrew installation, or custom paths
  • Async/Await Support: Fully asynchronous API with CancellationToken support
  • Streaming Support: Handles streaming operations for logs, video, and test results
  • Strong Typing: All API responses mapped to strongly-typed C# models

Requirements

  • macOS (required - IDB only works on macOS)
  • .NET 8.0 or later
  • Xcode with iOS Simulator support
  • idb_companion binary (installed via Homebrew or bundled)

Installation

brew tap facebook/fb
brew install idb-companion

Install NuGet Package

dotnet add package AppleDev.FbIdb

Quick Start

using AppleDev.FbIdb;
using AppleDev.FbIdb.Models;

// Create a client for a specific simulator UDID
await using var client = new IdbClient("SIMULATOR-UDID-HERE");

// Connect to the companion
await client.ConnectAsync();

// Get target information
var description = await client.DescribeAsync();
Console.WriteLine($"Connected to: {description.Name} ({description.OsVersion})");

// List installed apps
var apps = await client.ListAppsAsync();
foreach (var app in apps)
{
    Console.WriteLine($"  {app.BundleId} - {app.Name}");
}

// Take a screenshot
var screenshot = await client.ScreenshotAsync();
await File.WriteAllBytesAsync("screenshot.png", screenshot.ImageData);

// Set simulated location
await client.SetLocationAsync(37.7749, -122.4194); // San Francisco

API Overview

Connection & Management

  • ConnectAsync() - Connect to the companion
  • DescribeAsync() - Get target description
  • LogAsync() - Stream device/companion logs

App Lifecycle

  • InstallAsync() - Install apps, xctest bundles, dylibs, dsyms, frameworks
  • UninstallAsync() - Uninstall an app
  • LaunchAsync() - Launch an app with arguments and environment
  • TerminateAsync() - Terminate a running app
  • ListAppsAsync() - List installed apps

Media & Screenshots

  • ScreenshotAsync() - Take a screenshot (automatically falls back to simctl for simulators)
  • AddMediaAsync() - Add photos/videos to the device

Interaction (HID)

  • TapAsync() - Tap at a point
  • SwipeAsync() - Perform swipe gesture
  • PressButtonAsync() - Press hardware buttons (Home, Lock, etc.)
  • SendKeyAsync() - Send keyboard input
  • FocusAsync() - Focus the simulator window

Settings & Permissions

  • ApprovePermissionAsync() - Grant app permissions
  • RevokePermissionAsync() - Revoke app permissions
  • SetSettingAsync() / GetSettingAsync() - Manage device settings
  • SetHardwareKeyboardAsync() - Enable/disable hardware keyboard
  • ClearKeychainAsync() - Clear the keychain
  • SetLocationAsync() - Set simulated GPS location

File Operations

  • ListFilesAsync() - List directory contents
  • MakeDirAsync() - Create directories
  • PushAsync() / PullAsync() - Transfer files to/from device
  • MoveAsync() / RemoveAsync() - Move/delete files

Crash Logs

  • ListCrashLogsAsync() - List crash logs
  • GetCrashLogAsync() - Get crash log contents
  • DeleteCrashLogsAsync() - Delete crash logs

XCTest

  • ListTestBundlesAsync() - List installed test bundles
  • ListTestsAsync() - List tests in a bundle
  • RunTestsAsync() - Run tests and get results
  • RunTestsStreamAsync() - Stream test results as they complete

Notifications & Misc

  • SendNotificationAsync() - Send push notifications
  • OpenUrlAsync() - Open a URL
  • SimulateMemoryWarningAsync() - Trigger memory warning

Configuration

var options = new IdbCompanionOptions
{
    // Use a custom companion binary path
    CompanionPath = "/path/to/idb_companion",
    
    // Specify a fixed gRPC port (0 = auto-assign)
    GrpcPort = 0,
    
    // Adjust timeouts
    StartupTimeout = TimeSpan.FromSeconds(30),
    OperationTimeout = TimeSpan.FromSeconds(60),
    
    // Enable verbose logging
    VerboseLogging = true
};

await using var client = new IdbClient("UDID", options);

Environment Variable

You can also set the companion path via environment variable:

export IDB_COMPANION_PATH=/path/to/idb_companion

Connecting to Existing Companion

If you have an idb_companion already running:

// Connect to an existing gRPC server
var client = IdbClient.ConnectToExisting("http://localhost:12345");

Running XCTests

var request = new XctestRunRequest
{
    TestBundleId = "com.example.MyAppTests",
    Mode = new XctestMode.Application("com.example.MyApp"),
    CollectCoverage = true,
    ReportActivities = true
};

var result = await client.RunTestsAsync(request);

Console.WriteLine($"Status: {result.Status}");
foreach (var test in result.Results)
{
    var status = test.Status == TestStatus.Passed ? "✓" : "✗";
    Console.WriteLine($"  {status} {test.FullName} ({test.Duration:F2}s)");
}

Streaming Test Results

await foreach (var test in client.RunTestsStreamAsync(request))
{
    Console.WriteLine($"[{test.Status}] {test.FullName}");
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Facebook IDB - The underlying iOS Development Bridge
  • gRPC - High-performance RPC framework
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.10 91 5/7/2026
0.8.9 126 4/8/2026
0.8.7 109 3/6/2026
0.8.2 112 2/9/2026
0.8.1 123 2/4/2026