Ancestors

Toot

Written by Rob Napier on 2024-12-15 at 18:53

Has anyone used WeatherKit from a commandline tool? I've set up the capability on my bundle identifier at developer.apple.com, but in Xcode the capability doesn't appear in the "+ Capability" list. I could fall back to the REST API, but that adds a lot of complexity that the Swift framework does for you.

=> More informations about this toot | More toots from cocoaphony@mastodon.social

Descendants

Written by Rob Napier on 2024-12-15 at 19:37

Though I'm not sure if I can fall back to the REST API or not. I want historical data (dailyStatistics in the Swift API), and I'm not seeing that available on the REST side. It looks like you might be able to take specific snapshots by passing currentAsOf, but I don't see anywhere they publish high/low temperatures for a given day.

(I'm computing degree-days for an energy-tracking tool I'm working on.)

=> More informations about this toot | More toots from cocoaphony@mastodon.social

Written by Scott Perry on 2024-12-15 at 20:04

@cocoaphony not sure if this is the issue you're facing but one of the problems I've had building clis is that they don't have a bundle and a lot of stuff is built assuming the executable is inside one. You can work around this to some extent by pushing down into (and linking) your own framework or using an app target (deleting the UI boilerplate and treating it like a cli that lives inside a bundle)

=> More informations about this toot | More toots from numist@xoxo.zone

Written by Rob Napier on 2024-12-15 at 20:49

@numist I believe that entitlements can be applied via codesign (passing the --entitlements parameter). Other entitlements are added that way from what I'm seeing. I did try just directly adding the WeatherKit entitlement this way, but it SIGKILLs as soon as I launch.

=> More informations about this toot | More toots from cocoaphony@mastodon.social

Written by Félix on 2024-12-15 at 21:26

@cocoaphony @numist entitlements do work on freestanding executables because they are stored along with the code signature. The console will have info on why your program was killed

=> More informations about this toot | More toots from fay59@tech.lgbt

Written by Quinn “The Eskimo!” on 2024-12-15 at 21:26

@cocoaphony The entitlement claim needs to be authorised by a profile, which need a bundle structure.

https://developer.apple.com/documentation/xcode/signing-a-daemon-with-a-restricted-entitlement

=> More informations about this toot | More toots from justkwin@toot.community

Written by Steven G. Harris on 2024-12-15 at 23:17

@justkwin @cocoaphony FWIW, I did this to use CloudKit from a CLI and wrote about it in the readme of this project in the “Creating a Wrapped CLI” section. https://github.com/stevengharris/NSXcode. The section discussing the wrapped CLI is at https://github.com/stevengharris/NSXcode#creating-a-wrapped-cli

=> More informations about this toot | More toots from stevengharris@mastodon.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113658353332877755
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
1581.364131 milliseconds
Gemini-to-HTML Time
1.112876 milliseconds

This content has been proxied by September (ba2dc).