Skip to content

Instantly share code, notes, and snippets.

@foriequal0
Created March 1, 2026 16:31
Show Gist options
  • Select an option

  • Save foriequal0/5a450bbb39d260957ddc81f8e83c2afd to your computer and use it in GitHub Desktop.

Select an option

Save foriequal0/5a450bbb39d260957ddc81f8e83c2afd to your computer and use it in GitHub Desktop.
Fix Unity3d Android Build Support's NDK path symlink
#!/usr/bin/env bash
UNITY_HUB_EDITOR=${1:-$HOME/Unity/Hub/Editor}
pushd "$UNITY_HUB_EDITOR" > /dev/null
for UNITY in *; do
echo "Checking: $UNITY"
CLANGPP="./$UNITY/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++"
if ! [ -f "$CLANGPP" ]; then
echo " Android Build Support is not installed"
continue
fi
LINKED_TO=$(readlink "$CLANGPP")
NDK_VERSION=$(sed -nE 's/^.*\/NDK\/(.*)\/toolchains\/.*$/\1/p' <<<"$LINKED_TO")
echo " NDK version detected: $NDK_VERSION"
pushd "./$UNITY/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/" > /dev/null
echo " Making symlink"
ln -s ./ "./$NDK_VERSION"
popd > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment