Allow manual Xcode installation. No sudo in ssh execution.

This commit is contained in:
2025-05-27 20:22:35 +00:00
parent 474d2f1881
commit 6c59e67dda
2 changed files with 11 additions and 3 deletions

View File

@@ -70,11 +70,19 @@ cd /tmp
rm -rf /tmp/links_
echo Please connect using VNC to port :5999 and log into the Mac App Store manually
echo or install Xcode by manually downloading from https://developer.apple.com/download/all/?q=xcode
echo and expanding the .xip and moving the result to /Applications
read -p "Press any key to when done.. " -n1 -s
## Install apps from Mac App Store (497799835 - Xcode)
## Install apps from Mac App Store (497799835 - Xcode) ...
echo Installing apps from Mac App Store
docker exec -i $cntName /usr.orig/bin/ssh 127.0.0.1 '/usr/local/bin/mas install 497799835'
## ... or download Xcode.xip manually from https://developer.apple.com/download/all/?q=xcode, double click for expand and move it to /Applications
docker exec -i $cntName /usr.orig/bin/ssh 127.0.0.1 'sudo xcode-select -s /Applications/Xcode.app/Contents/Developer'
# May need to be run interactively
docker exec -i $cntName /usr.orig/bin/ssh 127.0.0.1 'sudo xcodebuild -license accept'
#
docker exec -i $cntName /usr.orig/bin/ssh 127.0.0.1 'sudo xcodebuild -runFirstLaunch'
docker exec -i $cntName /usr.orig/bin/ssh 127.0.0.1 'sudo xcodebuild -downloadPlatform iOS'
echo If all went smoothly then execute docker commit $cntName osx:act

2
run.sh
View File

@@ -26,4 +26,4 @@ if ! ps -aux|grep -q [^\[]qemu[-]system; then
fi
fi
cat /proc/self/environ|ssh 127.0.0.1 'vars=(); while read -rd '"''"' keyVal; do; key=${keyVal%=*}; val=${keyVal#*=}; if [[ "$keyVal" == "GITHUB_WORKSPACE=/drone/src" ]]; then keyVal="GITHUB_WORKSPACE=/Users/mac/drone/src"; fi; if (( ! ${(P)+key} )); then vars+=("$keyVal"); elif [[ "$key" == "PATH" ]]; then vars+=("PATH=$val:$PATH"); fi; done; pwd="'"$PWD"'"; if [ -d "$pwd" ] ; then cd "$pwd"; fi; sudo -E env -i "${vars[@]}" '"$0"' '"$@"
cat /proc/self/environ|ssh 127.0.0.1 'vars=(); while read -rd '"''"' keyVal; do; key=${keyVal%=*}; val=${keyVal#*=}; if [[ "$keyVal" == "GITHUB_WORKSPACE=/drone/src" ]]; then keyVal="GITHUB_WORKSPACE=/Users/mac/drone/src"; fi; if (( ! ${(P)+key} )); then vars+=("$keyVal"); elif [[ "$key" == "PATH" ]]; then vars+=("PATH=$val:$PATH"); fi; done; pwd="'"$PWD"'"; if [ -d "$pwd" ] ; then cd "$pwd"; fi; env -i "${vars[@]}" '"$0"' '"$@"