#!/bin/bash # Crkl Setup Script # This script sets up the Android SDK and environment for Crkl development set -e echo "🚀 Setting up Crkl development environment..." # Check if we're in the right directory if [ ! -f "Makefile" ]; then echo "❌ Error: Please run this script from the Crkl project root directory" exit 1 fi # Setup Android SDK echo "📱 Setting up Android SDK..." make setup-sdk # Add environment variables to shell profile SHELL_PROFILE="" if [ -f "$HOME/.zshrc" ]; then SHELL_PROFILE="$HOME/.zshrc" elif [ -f "$HOME/.bashrc" ]; then SHELL_PROFILE="$HOME/.bashrc" fi if [ -n "$SHELL_PROFILE" ]; then echo "🔧 Adding environment variables to $SHELL_PROFILE..." # Check if already added if ! grep -q "ANDROID_HOME" "$SHELL_PROFILE"; then echo "" >> "$SHELL_PROFILE" echo "# Crkl Android SDK" >> "$SHELL_PROFILE" echo "export ANDROID_HOME=\$HOME/android-sdk" >> "$SHELL_PROFILE" echo "export PATH=\$ANDROID_HOME/platform-tools:\$PATH" >> "$SHELL_PROFILE" echo "✓ Environment variables added to $SHELL_PROFILE" else echo "✓ Environment variables already present in $SHELL_PROFILE" fi fi # Build the project echo "🔨 Building Crkl APK..." make build echo "" echo "✅ Setup complete!" echo "" echo "Next steps:" echo "1. Connect your Android tablet/phone via USB" echo "2. Enable Developer Options and USB Debugging on your device" echo "3. Run: make check-device" echo "4. Run: make install" echo "5. Run: make run" echo "" echo "For help, run: make help"