Charles Proxy Licensing via Jamf - adtejaa/jamf-notes GitHub Wiki

📝 Charles Proxy Licensing and Script Workflow Documentation

🔧 Objective

Document how Charles Proxy picks up its license and how the deployment script automates licensing via Jamf, even when silent injection is not supported.


🧠 Charles License Injection Behavior

Charles Proxy does not accept a license file silently unless the app has been launched at least once by the user. To handle this, we automate:

  1. First-time app launch
  2. Triggering Preferences
  3. Injecting license via AppleScript

🛠️ Script Workflow Summary

✅ Function

Your script ensures Charles Proxy is fully licensed without any user interaction.


📂 Actions Performed

  1. Launch Charles Proxy via AppleScript:

    tell application "Charles" to activate
    delay 2
    tell application "System Events"
        keystroke "," using {command down} -- Opens Preferences
        delay 1
    end tell
    
  2. Inject license via AppleScript UI automation (example placeholder):

    tell application "System Events"
        tell process "Charles"
            click button "Register" of window "Preferences"
            set value of text field 1 of group 1 of window "Register" to "Your Name"
            set value of text field 2 of group 1 of window "Register" to "XXXXX-XXXXX-XXXXX"
            click button "OK" of window "Register"
        end tell
    end tell
    
  3. Quit Charles:

    tell application "Charles" to quit
    
  4. (Optional) Verify license file:

    ls ~/Library/Preferences/com.xk72.charles.license.xml
    

🚀 Jamf Deployment

  • Script is deployed via Jamf Policy

  • Triggered using:

    sudo jamf policy -event install_charles
    
  • Script handles:

    • App launch
    • Preferences navigation
    • License registration
    • App exit

✅ Outcome

  • Charles is fully licensed on first install
  • No end-user prompts or trial warnings
  • Seamless automation for first-run licensing

📝 Notes

  • AppleScript UI automation requires Accessibility permission.
  • PPPC configuration profile should allow:
    • System Events and Charles under AppleEvents
    • Accessibility access for script runner (e.g., Jamf binary or management app)