Support for arm64 apps on arm64e.x1 devices (iPhone Duo)
Summary:
Context
idb fails to install builds on iPhone Duo with the following error.
The supported architectures of the target [] do not intersect with any architectures in the bundle: [arm64]That’s because iPhone Duo’s architecture is
arm64e.x1which idb currently does not know about.This diff
Extend the architectures mapping with support for
arm64e.x1
landed-with-radar-review
Differential Revision: D127701518
fbshipit-source-id: 448e476620ff9a36c70034c0928c11952803e303
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
The “iOS Development Bridge” or
idb, is a command line interface for automating iOS Simulators and Devices. It has three main principles:idbis composed of a “companion” that runs on macOS and a python client that can run anywhere. This enables scenarios such as a “Device Lab” within a Data Center or fanning out shards of test executions to a large pool of iOS Simulators.idbexposes granular commands so that sophisticated workflows can be sequenced on top of them. This means you can useidbfrom an IDE or build an automated testing scenario that isn’t feasible with default tooling. All of these primitives aim to be consistent across iOS versions and between iOS Simulators and iOS Devices. All the primitives are exposed over a cli, so that it’s easy to use for both humans and automation.idbleverages many of Private Frameworks that are used by Xcode, so that these features can be in GUI-less automated scenarios.idbis built on top of theFBSimulatorControlandFBDeviceControlmacOS Frameworks, contained within this repository. These Frameworks can be used independently ofidb, howeveridbis likely to provide the simplest install and the most sensible defaults for most users.idbis nearly a pure Swift codebase: the companion and the Frameworks are written in Swift, apart from the XCTestDTXlayer inFBXCTestCore. The architecture documentation describes where the migration stands.A talk from F8 2019 covers the original motivation for
idb; a recording is available here.Quick Start
idbis made up of 2 major components, both of which are installed by a single brew formula.idbcompanionEach target (simulator/device) will have a companion process attached allowing
idbto communicate remotely.The
idbcompanion can be installed via brew or built from sourceNote: Instructions on how to install brew can be found here
To install the CI build of any commit or pull request, run
./homebrew.pyfrom a checkout; see Installing a specific build.idbclientA cli tool and python client is provided to interact with
idb.It is installed alongside the companion by the brew formula above. It can also be installed separately via pip (releases publish to PyPI):
Note: The idb client requires python 3.10 or greater to be installed.
Please refer to fbidb.io for detailed installation instructions and a guided tour of idb.
Once installed, just run the list-targets command which will show you all the simulators installed on your system:
list-appswill show you all the apps installed in a simulator:launchwill launch an application:Head over to the main documentation for more details on what you can do with idb and the full list of commands. There are also instructions on how to make changes to
idbincluding building it from source.Building from Source
Prerequisites
brew install xcodegenbuild.shbuilds both Swift codegen plugins itself —protoc-gen-swiftandprotoc-gen-grpc-swift-2— using the versions and revisions inPackage.resolved, so the generated code matches the runtime it is generated against.)Building
The build writes individual products under
Build/Products, with macOS products underBuild/Products/Releaseand simulator products under platform-specificRelease-*directories. The framework targets are static libraries linked into the executables, so they are not copied into the runtime distribution. A full./build.sh buildassembles the self-contained distribution atBuild/Distribution:The executables resolve their bundled runtime dependencies relative to their own location. Keep
Build/Distributiontogether when copying or relocating it.Running Tests
Regenerating Xcode Projects
The Xcode project files are generated from
project.ymlusing XcodeGen. To regenerate without building:Documentation
Find the full documentation for this project at fbidb.io
We also have a public Discord Server that you can join
Contributing
We’ve released
idbbecause it’s a big part of how we scale iOS automation at Facebook. We hope that others will be able to benefit from the project where they may have needs that aren’t currently serviced by the standard Xcode toolchain.Code of Conduct
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
Contributing Guide
Read our contributing guide to learn about our development process.
License
idbis MIT-licensed.Updating Swift dependencies
Package.resolvedis the shared lock for the runtime and both Swift codegen plugins. Keep the exact versions inPackage.swiftandCompanion/project.ymlin agreement with it.build.shstages the lock in the generated Xcode workspace and disables automatic package resolution. It checks the resolved versions, revisions, and repositories after both plugin and Xcode builds.Codegen uses an incremental SwiftPM build in
Build/Codegen. Each build validates the lock even when cached plugin binaries exist, and regenerates the protocol sources before XcodeGen expands their source globs. A dependency bump therefore cannot silently reuse older generated sources.Run
bash tests/build-test.sh "$PWD"andpython3 -m unittest CI.dependency_lock_testsfrom this directory to check the dependency guards without an Apple toolchain. GitHub CI runs both.