Created
April 3, 2023 21:12
-
-
Save stephancasas/1e1bf8071c5feedb8a60cd1cc6b82032 to your computer and use it in GitHub Desktop.
Restart the macOS Sidecar session being hosted by avconferenced
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
#!/usr/bin/env osascript -l JavaScript | |
const App = Application.currentApplication(); | |
App.includeStandardAdditions = true; | |
const BINARY = '/usr/libexec/avconferenced'; | |
function run(_) { | |
const avconferenced = App.doShellScript( | |
`ps -A | grep '${BINARY}' | awk '{print $1,$4}'`, | |
) | |
.split('\r') | |
.map((process) => process.split(' ')) | |
.find(([_, exec]) => exec == BINARY); | |
if (!avconferenced) { | |
return; | |
} | |
App.doShellScript(`kill -9 ${avconferenced[0]}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sidecar keeps freezing-up on my Mac, and I'm tired of having to physically disconnect/reconnect my iPad to fix it.
This JXA script locates the ongoing
avconferenced
process and kills it. macOS will automatically reboot the connection shortly thereafter.I miss Monterrey. Ventura killed sidecar for me.