The Nudge Launch Agent Do not open

Vinyboy
New Contributor III

Hello Team,

After installing Nudge and pushing the configuration profile, the Nudge Agent do not open. 
We have 12.4.0 version of OS Installed.


Please let me know what is that has to be changed/Modified.

 

I've install Nudge_Suite-1.1.8.81421.pkg and configured the profile too.

Upload File
PLIST file containing key value pairs for settings in the specified domain
 

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PayloadContent</key> <array> <dict> <key>PayloadContent</key> <dict> <key>com.github.macadmins.Nudge</key> <dict> <key>Forced</key> <array> <dict> <key>mcx_preference_settings</key> <dict> <key>optionalFeatures</key> <dict> <key>acceptableApplicationBundleIDs</key> <array> <string>us.zoom.xos</string> <string>com.apple.iWork.Keynote</string> <string>com.apple.Keynote</string> <string>com.microsoft.Powerpoint</string> <string>com.cisco.webexmeetingsapp</string> <string>com.webex.meetingmanager</string> <string>Cisco-Systems.Spark</string> </array> <key>aggressiveUserExperience</key> <true/> <key>attemptToFetchMajorUpgrade</key> <true/> <key>enforceMinorUpdates</key> <true/> </dict> <key>osVersionRequirements</key> <array> <dict> <key>aboutUpdateURL</key> <string>https://support.apple.com/en-us/HT212585</string> <key>requiredInstallationDate</key> <string>2022-8-05T17:00:00Z</string> <key>requiredMinimumOSVersion</key> <string>12.5.0</string> <key>targetedOSVersionsRule</key> <string>12</string> </dict> </array> <key>userExperience</key> <dict/> <key>userInterface</key> <dict> <key>iconDarkPath</key> <string>/path/to/image.png</string> <key>iconLightPath</key> <string>/path/to/other-image.png</string> <key>showDeferralCount</key> <true/> <key>singleQuitButton</key> <true/> <key>updateElements</key> <array> <dict> <key>_language</key> <string>en</string> <key>mainContentText</key> <string>Hey there! \n\nWe noticed this Mac has available software updates. Keeping macOS up-to-date is an important part in keeping devices and data secure.\n\nPlease update this Mac by clicking the Update Device button to install the available updates.</string> <key>mainHeader</key> <string>This Mac requires a security update</string> <key>subHeader</key> <string>A friendly reminder from IT ❤️</string> </dict> </array> </dict> </dict> </dict> </array> </dict> </dict> <key>PayloadDisplayName</key> <string>Custom Settings</string> <key>PayloadIdentifier</key> <string> </string> <key>PayloadOrganization</key> <string> </string> <key>PayloadType</key> <string> </string> <key>PayloadUUID</key> <string> </string> <key>PayloadVersion</key> <integer>1</integer> </dict> </array> <key>PayloadDescription</key> <string></string> <key>PayloadDisplayName</key> <string>Nudge OS Update Settings</string> <key>PayloadEnabled</key> <true/> <key>PayloadIdentifier</key> <string> </string> <key>PayloadOrganization</key> <string> </string> <key>PayloadRemovalDisallowed</key> <true/> <key>PayloadScope</key> <string>System</string> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string> </string> <key>PayloadVersion</key> <integer>1</integer> </dict> </plist>

 

29 REPLIES 29

ckulesza
New Contributor III

Having the same issue hopefully someone will respond with some info

bwoods
Valued Contributor

I would suggest uploading the Jamf schema and turning on the required keys mentioned in the wiki. Also, is it not launching when you click on it or when you run your launch agent? Let me know if you need screenshots.

Vinyboy
New Contributor III

Hello bwoods,

The Launch agent do not turn on. It would be much appreciated if you can help me with modifed changed that has to be done in custom Schema with screenshot.

bwoods
Valued Contributor

The jamf schema can be found here. You can upload it to your jamf pro server using "External Applications" in the "Application & Custom Settings" payload. (This is a configuration profile payload)

Select "Custom Schema" as the source.

bwoods_0-1659574109012.png

The preference domain will be com.github.macadmins.Nudge

 

bwoods_1-1659574293856.png

 

Click "Add schema" and copy/paste the code block from the URL above.

bwoods_2-1659574359010.png

Click "Save" instead of "Upload". 

bwoods_3-1659574437681.png

You'll now have a simple GUI to activate and deactivate features.

According to the wiki, Nudge will not open until the following keys have been configured. ( I suggest only enabling these three keys before doing any thing else.)

bwoods_1-1659574878243.png

After configuring the keys above, you need to deploy the profile to a test machine and manually open nudge without a launch agent to see if it works. If it doesn't, something is wrong. If it does, move on to the launch agent. 

Below I have a script that creates and loads a custom launch agent for me. You can change the Start Interval to whatever you want. Below I have it set to 14400. ( 4 hours)

 

!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.github.macadmins.Nudge</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
	</array>
		<key>RunAtLoad</key>
			<true/>
	<key>StartInterval</key>
		<integer>14400</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0		## Success
exit 1		## Failure

 

 

 

Vinyboy
New Contributor III

Hello Bwoods,

Now I'm manually able to open the Nudge. as the Configuration you mentioned.
But now the launch agent is not opening automatically as you mentioned "custom launch agent". I've changed the start interval to 1600. But no pop-ups.
Note:- I haven't install the Launch Agent pkg yet.

bwoods
Valued Contributor

For the launch agent to work, you need to ensure that nudge is installed in the default path:

/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge

What path are you installing nudge in?

bwoods
Valued Contributor

Quick edit. The shebang is missing in the launch agent script. My bad. 

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.github.macadmins.Nudge</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
	</array>
		<key>RunAtLoad</key>
			<true/>
	<key>StartInterval</key>
		<integer>14400</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0		## Success
exit 1		## Failure

mforeman1
New Contributor III

Hello @bwoods I did follow the steps ^ but nudge is still not opening. Anything I missed?

bwoods
Valued Contributor

Are you able to open it manually without the launch agent?

bwoods
Valued Contributor

@mforeman1 FYI, it won't open if you're already running the latest version of the OS. It's best to test with a VM or build a usb to go back to an older version.

mforeman1
New Contributor III

@bwoods Got it. Looking good now. One last thing how can I redirect the user to the softwareupdate in Mac when they click "update device" in nudge?

bwoods
Valued Contributor

That should be the default behavior if you configure the keys I mentioned above. 

bwoods_0-1670356890677.png

 

mforeman1
New Contributor III

hmm that's weird, coz I already did that but seems every time I click on the update device nothing happens

bwoods
Valued Contributor

What OS version is the machine running and what did you set as the minimum requirement?

mforeman1
New Contributor III

Im good now. I just redirected the "update device" button to the softwareupdate prefpane path and  voila! it works. Thank you again!

Ismere
Contributor

Hi everyone,

If Nudge is still not starting you can also open up a Terminal and let the logstream run while trying to open it.
You can also increase the amount of Information in the logs according to the github page of it: https://github.com/macadmins/nudge/wiki/Logging

Default log:

log stream --predicate 'subsystem == "com.github.macadmins.Nudge"' --style syslog --color none

Sharing the output of this log would make it easier to help. 

I also see that you have defined the targetedOSVersionsRule:

<key>targetedOSVersionsRule</key> <string>12</string>

In theory this key works totally fine but for some reason, in our tests, Nudge never started on any MacOS 12 System as long as we did not used default as the Value for this key.

OvativePaul
New Contributor

Hello All,

This post is old I know but curious if I could get a little help. I have the Nudge.pkg deploying via JAMF's Mac Apps, I deployed the LaunchAgent via a policy in JAMF. I have the custom schema uploaded into a configuration profile with deferrals set, install date, and minimum OS version. Nudge launches fine as is and it has no problems, it is set to default every 30 minutes without an edited LaunchAgent.

Here is where I am stuck and where the documentation gets a bit confusing to me. All I want is the Launch Agent to launch Nudge every 4 hours such as what @bwoods describes (14400). Can someone please break it down in the simplest terms what is needing to be done here to get the Launch Agent edited? Do I need to somehow edit the plist that is in the PKG and repackage the Launch Agent? Do I need to deploy a custom script that will edit the plist for the Launch Agent, if so, how do I go about deploying that, would it be its own separate policy or deployed with the Launch Agent pkg in JAMF with the script set to take effect after the PKG is installed.

Any help or guidance would be appreciated, I am so close getting this to working how we want I have just been hitting a brick wall with editing of the Launch Agent, whether that means somehow editing the plist or deploying a script I am all ears! If it is a script I could use the one @bwoods gratefully shared but unsure if that is deployed by itself or with the Launch Agent .pkg, if it is do I need to alter filepaths or any kind?

 

Thank You!

 

-Paul Fye

bwoods
Valued Contributor

@OvativePaul , You can paste my script into Jamf Pro then add it to a policy. You just want it to run after the Nudge installation. 14400 seconds is equal to 4 hours. You can change when the pop-up appears by simply changing the seconds in the script above. (Use Google for a seconds to hours converter)

Basically, the only thing that you need to edit is the key below. Just edit the seconds whenever you want to change when Nudge launches. My replies below are my updated script. It has more logic built in.

<key>StartInterval</key>
		<integer>14400</integer>

 

bwoods
Valued Contributor

Example of 1 hour

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then 
	echo "Nudge launch agent is present"
	/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
	rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
	echo "Nudge launch agent is not present."
fi

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.github.macadmins.Nudge</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
	</array>
		<key>RunAtLoad</key>
			<true/>
	<key>StartInterval</key>
		<integer>3600</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0		## Success
exit 1		## Failure

bwoods
Valued Contributor

Example of 2 hours

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then 
	echo "Nudge launch agent is present"
	/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
	rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
	echo "Nudge launch agent is not present."
fi

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.github.macadmins.Nudge</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
	</array>
		<key>RunAtLoad</key>
			<true/>
	<key>StartInterval</key>
		<integer>7200</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0		## Success
exit 1		## Failure

bwoods
Valued Contributor

Example of 4 hours

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then 
	echo "Nudge launch agent is present"
	/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
	rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
	echo "Nudge launch agent is not present."
fi

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.github.macadmins.Nudge</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
	</array>
		<key>RunAtLoad</key>
			<true/>
	<key>StartInterval</key>
		<integer>14400</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0		## Success
exit 1		## Failure

leobrt
New Contributor III

Hi @bwoods ,
The result of your script shows me this error, any idea ?

Running script Create com.github.macadmins.Nudge.plist...
Script exit code: 0
Script result: Nudge launch agent is not present.
/Library/Application Support/JAMF/tmp/Create com.github.macadmins.Nudge.plist: line 20: /Users/myuser/Library/LaunchAgents/com.github.macadmins.Nudge.plist: No such file or directory
/Users/myuser/Library/LaunchAgents/com.github.macadmins.Nudge.plist: No such file or directory
Load failed: 2: No such file or directory

bwoods
Valued Contributor

That means that there's not launch agent present from a previous push. The script should then create a new launch agent for you.

TechGuy77
New Contributor II

Actually, in this instance, this means the LaunchAgents directory does not exist so it can't create the LaunchAgent file. I made an edit to fix this as I think it's an issue with newer MacOS version like Ventura as those directories don't exist for users by default anymore. Here is the script with my edit to make the directory needed before the echo.

 

#!/bin/bash

# Determine Current User
currentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# Determine Current User ID
currentUserUID=`id -u "$currentUser"`

# Verifies Presence of Nudge Launch Agent
if [[ -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then 
	echo "Nudge launch agent is present"
	/bin/launchctl asuser "$currentUserUID" launchctl unload /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
	rm -Rf /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist
elif [[ ! -f /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist ]]; then
	echo "Nudge launch agent is not present."
fi

mkdir "/Users/$currentUser/Library/LaunchAgents/"

# Generate Nudge launch agent
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.github.macadmins.Nudge</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
	</array>
		<key>RunAtLoad</key>
			<true/>
	<key>StartInterval</key>
		<integer>3600</integer>
</dict>
</plist>" > /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

# Load Launch Agent
/bin/launchctl asuser "$currentUserUID" launchctl load /Users/$currentUser/Library/LaunchAgents/com.github.macadmins.Nudge.plist

exit 0		## Success
exit 1		## Failure

 

  

bwoods
Valued Contributor

Good catch, that folder exists on all of my clients because of Onedrive. May not be the case for everyone else.

jender
New Contributor II

Thanks for this! Worked great on the majority of devices but I have a few outliers that error out. I get the "/Library/LaunchAgents/com.github.macadmins.Nudge.plist: No such file or directory" but instead of creating the plist I get "Load Failed: 5: Input/output error" Any ideas?

JCCL
New Contributor III

I pushed the launch agent that is part of the nudge suit package on GitHub. Will this script overwrite and/or stop that default agent and use your script instead? 

OvativePaul
New Contributor

Hey @Vinyboy I tried that before but never really use GitHub much so those Git Clone commands always fail for me. I will give it another shot. Thank You!