Forest_Client/Tool/BuildTool/upload_apk.sh

30 lines
604 B
Bash
Raw Normal View History

2024-06-12 15:01:54 +08:00
SHELL_DIR=$(dirname $0)
echo "change dir to $SHELL_DIR"
cd "$SHELL_DIR"
# Set remote server details (modify as needed)
REMOTE_USER="root"
REMOTE_HOST="132.232.113.98"
VERSION="$1"
PLATFORM="$2"
APP_NAME="MyUnityBuild.apk"
REMOTE_PATH="/var/www/html/nld/$PLATFORM/$VERSION/"
ssh "$REMOTE_USER@$REMOTE_HOST" "mkdir -p $REMOTE_PATH"
cd "../../Builds/$PLATFORM/$VERSION/"
scp "${APP_NAME}" "$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH"
upload_result=$?
if [ $upload_result -eq 0 ]; then
echo "apk uploaded to remote server successfully."
else
echo "Failed to upload apk to remote server."
fi