Trapeze is part of the Ionic Ecosystem →
Skip to main content

Capacitor

Trapeze makes it easy to automate the configuration of your Capacitor projects.

Configuration Tool

To use the Configuration-driven experience, first create a yaml file using the options available:

Here's an example:

config.yaml
platforms:
android:
manifest:
- file: AndroidManifest.xml
target: manifest/application
inject:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
ios:
targets:
App:
version: 16.4

npm install @trapezedev/configure
npx trapeze run config.yaml

API

Capacitor projects usually have platform projects in a single repo. Thus, pass the main project directory to the MobileProject constructor, and then pass the relative paths to the iOS and Android projects. Note: Capacitor puts the actual iOS project one level deeper inside of the ios folder, so pass that explicitly so the .xcodeproj can be found:

import { MobileProject, MobileProjectConfig } from '@trapezedev/project';

const config: MobileProjectConfig = {
ios: {
path: 'ios/App',
},
android: {
path: 'android',
},
};

const project = new MobileProject('/path/to/project/dir', config);
await project.load();