Post

Replies

Boosts

Views

Activity

Reply to macOS WeatherKit "A server with the specified hostname could not be found"
Here is the same code in Swift Playground: //import Cocoa //import Foundation import WeatherKit import CoreLocation var token = [String]() let escapedCity = "41.736,-88.095" token = escapedCity.components(separatedBy: ",") let weatherService = WeatherService() let lat = Double(token[0])! let long = Double(token[1])! let thisLocation = CLLocation(latitude: lat, longitude: long) let now = Calendar.current.date(byAdding: .hour, value: 1, to: Date())! let nextWeek = Calendar.current.date(byAdding: .day, value: 14, to: Date())! do { let (dailyForecast, hourlyForecast, currentWeather, alertWeather) = try await weatherService.weather(for: thisLocation, including: .daily, .hourly(startDate: now, endDate: nextWeek), .current, .alerts) print(String(format: "%.0f", currentWeather.temperature.converted(to: .fahrenheit).value)) print(String(format: "%.0f", hourlyForecast.count)) print(String(format: "%.0f", dailyForecast.count)) print(String(format: "%.0f", alertWeather?.count ?? 0)) } catch { print(String(format:" Weather try/catch1 error: %@", error.localizedDescription)) print(String(format:" Weather full service not available: %.3f,%.3f", lat, long)) } Returning the message: remoteProcessWasInterrupted
Sep ’25
Reply to macOS WeatherKit "A server with the specified hostname could not be found"
Here is the same code in Swift Playground format: //import Cocoa //import Foundation import WeatherKit import CoreLocation var token = [String]() let escapedCity = "41.736,-88.095" token = escapedCity.components(separatedBy: ",") let weatherService = WeatherService() let lat = Double(token[0])! let long = Double(token[1])! let thisLocation = CLLocation(latitude: lat, longitude: long) let now = Calendar.current.date(byAdding: .hour, value: 1, to: Date())! let nextWeek = Calendar.current.date(byAdding: .day, value: 14, to: Date())! do { let (dailyForecast, hourlyForecast, currentWeather, alertWeather) = try await weatherService.weather(for: thisLocation, including: .daily, .hourly(startDate: now, endDate: nextWeek), .current, .alerts) print(String(format: "%.0f", currentWeather.temperature.converted(to: .fahrenheit).value)) print(String(format: "%.0f", hourlyForecast.count)) print(String(format: "%.0f", dailyForecast.count)) print(String(format: "%.0f", alertWeather?.count ?? 0)) } catch { print(String(format:" Weather try/catch1 error: %@", error.localizedDescription)) print(String(format:" Weather full service not available: %.3f,%.3f", lat, long)) } And returns the message: remoteProcessWasInterrupted
Sep ’25
Reply to Hardened Runtime for distribution outside the Mac App store
# Developer email address dev_account=$(cat ~/.altoolid) # App-specific password dev_passwd=$(cat ~/.altoolpw) # Team ID 7WN..... dev_teamid=$(cat ~/.altooltm) # Developer ID Application: First Last or SHA value via security find-identity -p codesigning -v dev_codesign=$(cat ~/.altoolcs) xcrun notarytool store-credentials --apple-id "$dev_account" --team-id="$dev_teamid" --password "$dev_passwd" notary-scriptingosx # xcodebuild -help echo "{" > exportOptions.plist echo "\tdestination = export;" >> exportOptions.plist echo "\tsigningCertificate = \"Developer ID Application\";" >> exportOptions.plist echo "\tsigningStyle = automatic;" >> exportOptions.plist echo "\tteamID = ${dev_teamid};" >> exportOptions.plist echo "}" >> exportOptions.plist # Builds with **Apple Development**, not **Developer ID Application** # xcodebuild -project Meteorologist.xcodeproj -scheme Meteorologist -configuration Release -derivedDataPath ./Build -allowProvisioningUpdates --options=runtime clean archive -archivePath ./Build/Archive.xcarchive xcodebuild -exportArchive -archivePath ./Build/Archive.xcarchive -exportOptionsPlist exportOptions.plist -exportPath ./Build/Release # Display signing, look for runtime and Developer ID #codesign -dv --verbose=4 ./Build/Release/Meteorologist.app #security find-identity -p codesigning -v # Display entitlements #codesign -d --entitlements - --xml ./Build/Release/Meteorologist.app | plutil -convert xml1 -o - - # Create a ZIP archive suitable for notarization. /usr/bin/ditto -c -k --keepParent ./Build/Release/Meteorologist.app ./Build/Release/Meteorologist.zip # notarize xcrun notarytool submit ./Build/Release/Meteorologist.zip --wait --keychain-profile "notary-scriptingosx" > xcodebuild.log uuid=$(grep -m 1 -w "id:" xcodebuild.log | awk '{print $2}') echo "UUID=${uuid}" rm xcodebuild.log # Show results...needs uuid from above xcrun stapler staple "./Build/Release/Meteorologist.app"
Topic: App & System Services SubTopic: Hardware Tags:
Apr ’23
Reply to Hardened Runtime for distribution outside the Mac App store
I have found that I can sign using the key: codesign -s "A6BED0BFC51147B1D08CF9C38E568B58546928D0" --timestamp -f -o runtime ./Build/Release/Meteorologist.app That gets me around the ambiguous match. Before the codesign, /Build/Release/Meteorologist.app runs fine (albeit with Apple Developer). After the codesign, the app launches but immediately says: Location services are denied. This is covered in the existing entitlements. I found that I can ensure the entitlement is added/replaced as part of codesign by adding --entitlements: codesign -s "A6BED0BFC51147B1D08CF9C38E568B58546928D0" --timestamp --entitlements ./Meteorologist/Meteorologist.entitlements -f -o runtime ./Build/Release/Meteorologist.app But then I get the message: The application "Meteorologist can't be opened. Looking around in the Console, I see this: mac_vnode_check_signature: /Users/ed/Documents/Xcode-Projects/meteorologist/trunk/Build/Release/Meteorologist.app/Contents/MacOS/Meteorologist: code signature validation failed fatally: When validating /Users/ed/Documents/Xcode-Projects/meteorologist/trunk/Build/Release/Meteorologist.app/Contents/MacOS/Meteorologist: Code has restricted entitlements, but the validation of its code signature failed. Unsatisfied Entitlements: com.apple.developer.weatherkit While makes me think I'm back to square 1, except that when I use the Xcode GUI, it does work.
Topic: App & System Services SubTopic: Hardware Tags:
Apr ’23