Enable developer mode on macOS platforms

Previously when a VM user tried to attach lldb to a process via ssh,
lldb would fail with the following error message:
"error: process exited with status -1 (unable to attach)". If this
were done over VNC rather than ssh, the user would instead get a UI
popup to enter a password to allow debugging the process.

When trying to debug an application using Xcode for the first time,
Xcode will offer to enable the so called "Developer Mode" which allows
attaching a debugger without specifying a password every time.

This change enables "Developer Mode", so that every VM user doesn't
have to.

Change-Id: Ie4e473a982c908afd456ac1773bbdaf4ce778094
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Alexandru Croitor
2017-08-16 15:09:04 +02:00
committed by Liang Qi
parent f1b1f3dc09
commit dfaabde5dc

View File

@@ -51,6 +51,7 @@ function InstallXCode()
{
ExceptionCPIO=103
ExceptionAcceptLicense=105
ExceptionDeveloperMode=113
sourceFile=$1
version=$2
@@ -63,6 +64,9 @@ function InstallXCode()
echo "Accept license"
sudo xcodebuild -license accept || throw $ExceptionAcceptLicense
echo "Enabling developer mode, so that using lldb does not require interactive password entry"
sudo /usr/sbin/DevToolsSecurity -enable || throw $ExceptionDeveloperMode
echo "Xcode = $version" >> ~/versions.txt
)
catch || {
@@ -71,6 +75,10 @@ function InstallXCode()
echo "Failed to unarchive .cpio."
exit 1;
;;
$ExceptionDeveloperMode)
echo "Failed to enable developer mode."
exit 1;
;;
$ExceptionAcceptLicense)
echo "Failed to accept license."
exit 1;