Skip to content

Continue PR #275 with SMAppService launch-at-login - #282

Open
matthewcorven wants to merge 15 commits into
gao-sun:masterfrom
matthewcorven:matthewcorven/pr275-smappservice-mainapp
Open

Continue PR #275 with SMAppService launch-at-login#282
matthewcorven wants to merge 15 commits into
gao-sun:masterfrom
matthewcorven:matthewcorven/pr275-smappservice-mainapp

Conversation

@matthewcorven

Copy link
Copy Markdown

Summary

This PR is intended as a continuation of #275 by @nastarynaz rather than an independent rewrite. The Apple Silicon support, graph color picker work, deployment-target update, and build-script cleanup come from that earlier PR; this follow-up carries that work forward by replacing the remaining Intel-only login-item helper path with a modern macOS implementation.

Specifically, this change removes the LaunchAtLogin package and switches the preference toggle to ServiceManagement.SMAppService.mainApp.

What changed

  • removed the LaunchAtLogin Swift package from the Xcode project
  • removed the Copy LaunchAtLogin helper build phase
  • removed the LaunchAtLogin pin from Package.resolved
  • replaced the toggle backend in PreferenceGeneralView with an SMAppService.mainApp-backed store
  • preserved the existing UI surface for the preference while eliminating the embedded LaunchAtLoginHelper.app

Why this follow-up is needed

After building the #275 branch on Apple Silicon, the app still shipped an embedded LaunchAtLoginHelper.app that was x86_64-only. That produces macOS warnings about Intel-only components even though the main app and its extensions are arm64.

Using SMAppService.mainApp removes that helper entirely and aligns launch-at-login support with modern macOS behavior.

Build and signing notes

Unsigned CLI build

For a compile-only build without local signing setup:

GIT_CONFIG_COUNT=1 \
GIT_CONFIG_KEY_0=safe.bareRepository \
GIT_CONFIG_VALUE_0=all \
xcodebuild -scheme eul -project ./eul.xcodeproj clean build \
  CODE_SIGN_IDENTITY="" \
  CODE_SIGNING_REQUIRED="NO" \
  CODE_SIGN_ENTITLEMENTS="" \
  CODE_SIGNING_ALLOWED="NO"

Signed Xcode build

To test launch-at-login end to end, open eul.xcodeproj in Xcode and use a valid Apple development signing identity:

  1. Select the eul project.
  2. In Signing & Capabilities, keep Automatically manage signing enabled.
  3. Set Team for the app and related targets to your own Apple development team.
  4. Build and run from Xcode.

A signed build is required to verify the launch-at-login behavior in the running app.

Validation

  • clean xcodebuild compile with signing disabled succeeds
  • signed local Xcode build succeeds
  • resulting app bundle no longer contains LaunchAtLoginHelper.app or LaunchAtLogin_LaunchAtLogin.bundle

Attribution

Please treat this PR as building directly on top of the work in #275 by @nastarynaz.

niezhihai and others added 15 commits January 29, 2026 11:05
…e monitoring

- Add M-series specific SMC temperature sensors (Tp09, Tp0T, Tp05, Tg05)
- Update SmcControl to fallback to M-series sensors when Intel sensors unavailable
- Improve GPU monitoring to handle M-series integrated GPUs
- Add GitHub Actions artifact upload for easier testing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed SMCKeyInfoData.dataSize from IOByteCount (8 bytes on 64-bit) to UInt32 (4 bytes) to ensure SMCParamStruct is exactly 80 bytes as required by the SMC driver. This fixes the assertion failure on Apple Silicon Macs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add Double.init(fromFLT:) to parse FLT (float) format temperature data
- Update temperature() function to try SP78 first, then fallback to FLT
- Update allUnknownTemperatureSensors() to include FLT format sensors
- Fixes N/A temperature display on M-series Macs

The Apple Silicon Macs use FLT (4-byte float) format for temperature
sensors instead of SP78 (2-byte fixed-point) format used by Intel Macs.
This change enables proper temperature reading on M1/M2/M3 Macs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Catch all errors when trying SP78 format, not just specific error code
- This ensures FLT fallback works reliably on Apple Silicon Macs
- Simplifies error handling logic

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Problem:
- GPU shows N/A on Apple Silicon (M-series) Macs
- system_profiler doesn't provide device-id for Apple Silicon GPUs
- IOAccelerator doesn't provide IOPCIMatch for Apple Silicon GPUs

Solution:
1. GPU Detection (GPU.swift):
   - Use model name as deviceId fallback when device-id is not available
   - This allows Apple Silicon GPUs to be detected (e.g., "Apple M4 Pro")

2. GPU Statistics (GPU.swift):
   - Remove requirement for IOPCIMatch (was causing nil return)
   - Use "apple" as fallback pciMatch for Apple Silicon GPUs
   - GPU usage is available from PerformanceStatistics["Device Utilization %"]

3. GPU Matching (GpuStore.swift):
   - Detect Apple Silicon GPUs by checking if deviceId contains "apple" or " m"
   - Match Apple Silicon GPUs by pciMatch == "apple"
   - Keep Intel GPU matching logic (match by device ID in pciMatch)

Note on GPU Temperature:
- GPU temperature sensors (Tg*) exist but return SMC error 132 (read-only/unavailable)
- This appears to be a system limitation on Apple Silicon
- GPU temperature will show N/A, but usage percentage will work correctly

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add uptime days display in CPU menu block
- Update version from 1.6.2 to 1.6.3
- Add localization support for all 22 languages

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## Graph Bar Color
- Added GraphColorOption enum with 5 options: Monochrome, Red (#e03a3e),
  Blue (#009ddc), Orange (#f6821f), Yellow (#fcb827)
- EulComponentConfig now stores graphColor setting, persisted to UserDefaults
- LineChart accepts a color parameter (fill at 50% opacity, solid stroke)
- CpuView, GpuView, MemoryView pass config.graphColor.color to LineChart
- PreferenceComponentConfigView shows a color picker row (circle swatches)
  when 'Show Graph' is enabled — clicking a swatch applies it instantly

## Color Definitions
- Added .graphRed, .graphBlue, .graphOrange, .graphYellow to Color extension
- ProgressBarView now accepts a color parameter for bar fill (default .primary)

## Apple Silicon / Build Fixes
- Bumped MACOSX_DEPLOYMENT_TARGET from 10.15 → 11.0 for all targets
- Disabled SwiftFormat build phase (was blocking build by downloading SPM deps)
- Suppressed noisy SMC error 135 (SP78/FLT type mismatch on Apple Silicon —
  already handled by FLT fallback, was printing on every refresh cycle)
Continue the Apple Silicon and modern Xcode work from PR gao-sun#275 by removing the LaunchAtLogin helper dependency and switching the preference toggle to ServiceManagement.SMAppService.mainApp.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the needs review PR needs review label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review PR needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants