Created
January 30, 2025 09:31
-
-
Save celian-m/414fd812be97688b7636f0b46f38f926 to your computer and use it in GitHub Desktop.
Send notification to iOS Simulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SIMULATOR_IDENTIFIER="SIMULATOR_ID" #Get it from Xcode's Organizer | |
BUNDLE_IDENTIFIER="com.application.bundleId" | |
APNS_PAYLOAD=' | |
{ | |
"Simulator Target Bundle": "${BUNDLE_IDENTIFIER}", | |
"aps" : { | |
"alert" : { | |
"title" : "Hello World!", | |
"body" : "Cool!" | |
}, | |
"sound" : "default", | |
"badge" : 1, | |
} | |
} | |
' | |
echo $APNS_PAYLOAD | xcrun simctl push $SIMULATOR_IDENTIFIER $BUNDLE_IDENTIFIER - | |
# You can as well provide the apns payload file using : | |
# xcrun simctl push $SIMULATOR_IDENTIFIER $BUNDLE_IDENTIFIER /path/to/file.apns | |
# where file.apns contains a JSON like APNS_PAYLOAD above | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment