1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-06 19:40:08 +02:00
Files
app/DEVELOPER.md
Nico Verbruggen 949ba5b559 🔧 Build self-updater as part of main target
The self-updater is now a requirement for the main app to be able to be
built. You no longer need the existing binary. This makes it easier for
anyone to just try out the app locally and makes reproducible builds
also possible.

(This is done because the self-updater code will soon be moved to a
separate package, and I want to make this entire updater process
as simple as possible.)

In order to avoid the self-updater app from appearing as a product when
archiving a build, SKIP_INSTALL is set to true. This avoids a variety
of annoying issues including the archive appearing under "Other Items".
2024-05-31 23:54:42 +02:00

3.4 KiB

DEVELOPER README

Linting

This project uses the SwiftLint linter. You must install it and can run it like so:

swiftlint

It also automatically runs when you try to build the project. You'll get a warning if swiftlint is not installed, though. You can attempt to automatically fix issues:

swiftlint --fix

⚙️ Preferences

You can find the persisted configuration file in ~/Library/Preferences/com.nicoverbruggen.phpmon.plist

These values are cached by the OS. You can clear this cache by running:

defaults delete com.nicoverbruggen.phpmon && killall cfprefsd

🔧 Build instructions

build button in Xcode

PHP Monitor

If you'd like to build PHP Monitor yourself, you need:

  • Xcode (usually the latest version)

Once you have downloaded this repository, open PHP Monitor.xcodeproj, and you should be able to build the app for your system by pressing Cmd-R. This will create a debug build. (If Xcode complains about code signing, you can turn it off.)

Important: The updater now gets automatically built and included as part of the main target.

If you'd like to create a production build, choose "Any Mac" as the target and select Product > Archive.

🚀 Release procedure

  1. Merge into main
  2. Create tag
  3. Add changes to changelog + update security document
  4. Archive
  5. Notarize and prepare for own distribution
  6. After notarization, export .app
  7. Create zipped version
  8. Calculate SHA256: openssl dgst -sha256 phpmon.zip
  9. Upload to GitHub and add to tagged release
  10. Update Cask with new version + hash
  11. Check new version can be installed via Cask

🍱 Marketing Mode

You can enable marketing mode by setting the PHPMON_MARKETING_MODE environment variable. It preloads a list of (fake) domains in the domain window list for screenshot & marketing purposes.

launchctl setenv PHPMON_MARKETING_MODE true

🐛 Symbolication of crashes

If you have an archived build of the app and exported the DSYM, it is possible to symbolicate .ips crash logs.

For example, given the following crash (from an .ips file):

Thread 2 Crashed::  Dispatch queue: com.apple.root.user-initiated-qos
0   libswiftDispatch.dylib        	    0x7ff82aa3ab8c static OS_dispatch_source.makeProcessSource(identifier:eventMask:queue:) + 28
1   PHP Monitor                   	       0x1096907d8 0x10965e000 + 206808
                                                |            |
                                             address      load address
2   PHP Monitor                   	       0x1096903ac 0x10965e000 + 205740
3   PHP Monitor                   	       0x10968f88b 0x10965e000 + 202891

You must use the correct order for the the address and load address in the command below:

$ atos -arch x86_64 -o '/path/to/PHP Monitor.app.dSYM/Contents/Resources/DWARF/PHP Monitor' -l 0x10965e000 0x1096907d8
             |                                           |                                       |              |
             architecture                                path to DSYM                         load address    address

This will return the relevant information, for example:

FSWatcher.startMonitoring(_:behaviour:) (in PHP Monitor) (PhpConfigWatcher.swift:95)

For more information, see Apple's documentation.