Docs › development

Development

Repository

Both apps are described by project.yml files and generated with XcodeGen. After adding or removing source files run xcodegen generate in ios/ or mac/.

How it is built

Mac

iPhone

Build

cd mac && xcodegen generate
xcodebuild -project TermfoldMac.xcodeproj -scheme TermfoldMac -configuration Debug -destination 'platform=macOS' build

cd ios && xcodegen generate
xcodebuild -project Termfold.xcodeproj -scheme Termfold -configuration Debug -destination 'generic/platform=iOS Simulator' build

For a real iPhone, add -destination 'platform=iOS,id=<device id>' -allowProvisioningUpdates DEVELOPMENT_TEAM=<team id>.

Release of the Mac app

mac/scripts/release.sh archives the app, exports it signed with Developer ID, builds the disk image, sends it to Apple for notarization and staples the result to mac/build/release/Termfold.dmg.

One time setup:

  1. An Apple Developer Program membership. Xcode creates the Developer ID certificate during the export if the account is signed in.
  2. An app specific password from account.apple.com, stored with:
xcrun notarytool store-credentials termfold-notary --apple-id <apple id> --team-id <team id>

Debug options

Debug builds of the Mac app read these environment variables, so a test copy can run next to the real app. They do not exist in Release builds.

VariableEffect
TERMFOLD_PORTListen on another port.
TERMFOLD_NAMEAnnounce another name.
TERMFOLD_DATA_DIRKeep the list and the journal in another folder.
TERMFOLD_PAIR_FILEStart pairing at launch and write the link and PIN to this file.
TERMFOLD_IDLE_SECONDSIdle limit in seconds.
TERMFOLD_REQUIRE_APPROVALAsk before every connection.
TERMFOLD_APPROVE_FILEWrite allow or deny into this file to answer a request.
TERMFOLD_REVOKE_TRIGGERCreate this file to remove all phones.

The Mac app with -renderUI <folder> saves PNG pictures of its screens. The iPhone app accepts -pairLink <link> and -pairPIN <pin> to pair at launch.

Documentation

The pages in this folder are plain Markdown. The Mac app shows them in a window, in the order of the file names. Links between pages use the file names. Keep names of buttons exactly as they appear in the apps.