rastogisagar123
Contributor II

Managing macOS devices in a large-scale enterprise environment always need IT expertise. Even with a powerful MDM like Jamf Pro, IT admins often need to dive into the command line to truly get to the root of issues. 

 

In this blog, we will walk through real-world command-line troubleshooting techniques for both macOS system issues and Jamf Pro management. Whether you're dealing with failing profiles, app crashes, or failed policies, this post has your back with real commands that work. 

Getting Started: System Info at Your Fingertips 

 

Before troubleshooting, gather critical system details: 

Get system version: 

sw_vers 

 

rastogisagar123_0-1750102795043.png

 

List all installed system updates 

softwareupdate –history 

 

rastogisagar123_1-1750102795043.png

 

Hardware overview 

system_profiler SPHardwareDataType 

 

 

rastogisagar123_2-1750102795044.png

 

Check uptime 

uptime 

 

rastogisagar123_3-1750102795044.png

 

Check disk usage 

df -h 

 

rastogisagar123_4-1750102795044.png

Network Troubleshooting 

 

Network issues can sabotage everything—from app installs to MDM communication. 

Get current IP and interface details 

Ifconfig 

 

rastogisagar123_5-1750102795044.png

 

Test DNS resolution 

dig www.apple.com 

 

Check default gateway 

netstat -nr | grep default 

 

rastogisagar123_6-1750102795045.png

 

Ping Jamf Pro server 

ping your.jamf.server.com 

 

Test port connectivity (useful for MDM) 

nc -vz your.jamf.server.com 8443 

 

Jamf Agent & Daemon Health 

Check whether the Jamf framework is working as expected: 

 

Confirm Jamf binary exists 

which jamf 

 

Check Jamf version 

jamf -version 

 

Run all policies manually (force check-in) 

sudo jamf policy 

 

Enroll device manually 

sudo jamf enroll -prompt 

 

Check MDM profile status 

sudo profiles -P 

 

View MDM framework logs 

log show --predicate 'eventMessage contains "mdm"' --info --last 1h 

 

Profiles & Configuration Issues 

MDM profile issues are super common especially with Wi-Fi, VPN, or Security payloads. 

 

List all installed profiles 

profiles -C 

 

Remove a specific profile by identifier 

sudo profiles -R -p <profile-identifier> 

 

Reinstall MDM profile (if permitted) 

sudo profiles renew -type enrollment 

Tip: If profiles fail to install, check system.log or run: 

log show --predicate 'eventMessage contains "Profile installation failed"' --last 1h 

 

 Application & Process Troubleshooting 

Trouble with app installs or behavior. 

List all installed apps 

ls /Applications 

 

Check specific app version 

defaults read /Applications/Safari.app/Contents/Info CFBundleShortVersionString 

 

Kill and relaunch a hung app 

killall "Microsoft Word" 

 

Monitor real-time CPU usage 

top -o cpu 

 

Login, Boot & System Launch Daemons 

Apps and scripts failing at login or boot? Inspect LaunchAgents and LaunchDaemons: 

List all LaunchAgents 

ls /Library/LaunchAgents 

 

List all LaunchDaemons 

ls /Library/LaunchDaemons 

 

Check status of a specific LaunchDaemon 

sudo launchctl list | grep "com.jamf" 

 

Load or unload a LaunchDaemon manually 

sudo launchctl unload /Library/LaunchDaemons/com.company.script.plist 

sudo launchctl load /Library/LaunchDaemons/com.company.script.plist 

 

FileVault & Security Status 

Security compliance issues? Check FileVault and Gatekeeper: 

 

FileVault status 

fdesetup status 

 

Check Secure Token users 

sysadminctl -secureTokenStatus yourusername 

 

Gatekeeper status 

spctl --status 

 

System Integrity Protection (SIP) status 

csrutil status 

 

Jamf Binary Diagnostics 

Still unsure what's happening? Use verbose Jamf logging: 

Verbose policy runs 

sudo jamf policy -verbose 

 

Run recon to update inventory 

sudo jamf recon 

 

View Jamf logs 

cat /var/log/jamf.log 

 

Cleanup Tools & Reset Commands 

Sometimes a cleanup is all you need. 

Flush DNS cache 

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder 

 

Clear user/system cache (use cautiously) 

rm -rf ~/Library/Caches/* 

sudo rm -rf /Library/Caches/* 

 

Reset printing system 

sudo rm -r /System/Library/Printers/ 

sudo rm -r /Library/Printers/ 

 

Wrap-Up: Proactive Beats Reactive 

Command-line skills are your best defense when Jamf Self Service doesn’t launch, apps refuse to deploy, or profiles mysteriously disappear. Combining Jamf Pro's remote management with these hands-on terminal commands creates a powerful, efficient support model. 

 

Use these tools not just to fix but to prevent. And don't forget to automate frequent solutions via Jamf Scripts and Policies! 

2 Comments
Contributors
About the Author
I'm a technology evangelist with strong skills centred around Microsoft products and a passionate geek with big ideas to sell. Like many other people you know or have spoken to, I started out supporting users and answering telephones, I learnt a great deal, a little about technology (that people didn't like) but a lot about people - what makes them tick! These days much of my time is spent exploring ways of delighting users, going that extra mile to negate them needing to pick up the phone. Implementing technology that works with people is my love "Hey Mike, that device you gave me - it's changed my life!" that's what brings me smiles. Over the past few years I've spent pondering the work of IT and the shift to cloud, would I lose my job and need to do something more honest with my life? The answer of course was a resounding "nope!", cloud computing has reinvigorated a grey monosyllabic word in to a vibrant oil painting! No longer do we have to continue to follow processes written in hieroglyphics and continue to tread the same path of the last 15-20 years - we have options, lots and lots of options. So, from me you'd get a dynamic modern view of the world, I'd want to offer fresh ideas, challenge the traditions and bring about positive change that will delight your end users and save your business money along the way! Specialties: Microsoft Cloud, Office 365 , Enterprise Mobility Suite, MDM (InTune, Airwatch), BYOD,Windows 7, JAMF Cloud,Service Management..