Tutorial

Novas atualizações e melhorias para a Macfleet.

Aviso importante

Os exemplos de código e scripts fornecidos nestes tutoriais são apenas para fins educacionais. A Macfleet não é responsável por quaisquer problemas, danos ou vulnerabilidades de segurança que possam surgir do uso, modificação ou implementação destes exemplos. Sempre revise e teste o código em um ambiente seguro antes de usá-lo em sistemas de produção.

Manage Bluetooth Menu on Status Bar in macOS

Managing the visibility of system menus in the status bar is essential for maintaining a consistent user experience across your Mac fleet. This tutorial shows you how to control the Bluetooth menu display on macOS devices using shell scripts.

Why Manage Bluetooth Menu Visibility

Controlling the Bluetooth menu visibility helps with:

  • Consistent user experience: Standardize interface elements across all devices
  • Quick access management: Provide users with convenient Bluetooth controls
  • Support efficiency: Reduce support tickets by ensuring easy access to Bluetooth settings
  • Enterprise compliance: Maintain consistent UI standards across the organization
  • User productivity: Enable quick Bluetooth connection management

Understanding Control Center Configuration

macOS uses the Control Center preference system to manage status bar items. The Bluetooth menu is controlled through the com.apple.controlcenter.plist file with these key values:

  • Value 18: Show Bluetooth menu in status bar
  • Value 0: Hide Bluetooth menu from status bar

Basic Bluetooth Menu Management

Show Bluetooth Menu in Status Bar

#!/bin/bash

# Script to show Bluetooth menu on status bar
CurrentUser=$(ls -l /dev/console | awk '/ / { print $3 }')
CurrentUserUID=$(id -u "$CurrentUser")

launchctl asuser $CurrentUserUID sudo -iu "$CurrentUser" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18

echo "Bluetooth menu enabled on status bar for user: $CurrentUser"

Hide Bluetooth Menu from Status Bar

#!/bin/bash

# Script to hide Bluetooth menu from status bar
CurrentUser=$(ls -l /dev/console | awk '/ / { print $3 }')
CurrentUserUID=$(id -u "$CurrentUser")

launchctl asuser $CurrentUserUID sudo -iu "$CurrentUser" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 0

echo "Bluetooth menu hidden from status bar for user: $CurrentUser"

Enhanced Bluetooth Menu Management

Comprehensive Bluetooth Status Script

#!/bin/bash

# Enhanced Bluetooth menu management with validation
DEVICE_NAME=$(scutil --get ComputerName)
CURRENT_USER=$(ls -l /dev/console | awk '/ / { print $3 }')
CURRENT_USER_UID=$(id -u "$CURRENT_USER")
LOG_FILE="/var/log/macfleet_bluetooth_menu.log"

# Function to log messages
log_message() {
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
}

# Function to get current Bluetooth menu status
get_bluetooth_status() {
    local status=$(launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost read com.apple.controlcenter.plist Bluetooth 2>/dev/null)
    echo "$status"
}

# Function to show Bluetooth menu
show_bluetooth_menu() {
    launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18
    log_message "Bluetooth menu enabled on $DEVICE_NAME for user $CURRENT_USER"
}

# Function to hide Bluetooth menu
hide_bluetooth_menu() {
    launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 0
    log_message "Bluetooth menu hidden on $DEVICE_NAME for user $CURRENT_USER"
}

# Function to validate current state
validate_bluetooth_state() {
    local current_status=$(get_bluetooth_status)
    log_message "Current Bluetooth menu status: $current_status"
    
    if [ "$current_status" = "18" ]; then
        echo "✅ Bluetooth menu is currently visible in status bar"
    elif [ "$current_status" = "0" ]; then
        echo "❌ Bluetooth menu is currently hidden from status bar"
    else
        echo "⚠️  Bluetooth menu status is undefined or not set"
    fi
}

# Main execution
log_message "Starting Bluetooth menu management on $DEVICE_NAME"

# Check current status
validate_bluetooth_state

# Example: Show Bluetooth menu (uncomment to use)
# show_bluetooth_menu

# Example: Hide Bluetooth menu (uncomment to use)
# hide_bluetooth_menu

# Verify change
validate_bluetooth_state
log_message "Bluetooth menu management completed"

Interactive Bluetooth Menu Manager

#!/bin/bash

# Interactive Bluetooth menu manager
CURRENT_USER=$(ls -l /dev/console | awk '/ / { print $3 }')
CURRENT_USER_UID=$(id -u "$CURRENT_USER")

# Function to get current status
get_current_status() {
    local status=$(launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost read com.apple.controlcenter.plist Bluetooth 2>/dev/null)
    case "$status" in
        18) echo "visible" ;;
        0) echo "hidden" ;;
        *) echo "undefined" ;;
    esac
}

# Function to toggle Bluetooth menu
toggle_bluetooth_menu() {
    local current_status=$(get_current_status)
    
    if [ "$current_status" = "visible" ]; then
        launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 0
        echo "Bluetooth menu has been hidden from status bar"
    else
        launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18
        echo "Bluetooth menu has been shown in status bar"
    fi
}

# Display current status
echo "MacFleet Bluetooth Menu Manager"
echo "==============================="
echo "Device: $(scutil --get ComputerName)"
echo "User: $CURRENT_USER"
echo "Current Bluetooth menu status: $(get_current_status)"
echo ""

# Provide options
echo "Options:"
echo "1. Show Bluetooth menu"
echo "2. Hide Bluetooth menu"
echo "3. Toggle Bluetooth menu"
echo "4. Check current status"
echo ""

read -p "Enter your choice (1-4): " choice

case $choice in
    1)
        launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18
        echo "✅ Bluetooth menu is now visible in status bar"
        ;;
    2)
        launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 0
        echo "❌ Bluetooth menu is now hidden from status bar"
        ;;
    3)
        toggle_bluetooth_menu
        ;;
    4)
        echo "Current status: $(get_current_status)"
        ;;
    *)
        echo "Invalid choice. Please run the script again."
        ;;
esac

Advanced Control Center Management

Comprehensive Control Center Configuration

#!/bin/bash

# Comprehensive Control Center menu management
CURRENT_USER=$(ls -l /dev/console | awk '/ / { print $3 }')
CURRENT_USER_UID=$(id -u "$CURRENT_USER")

# Define Control Center menu items and their values
declare -A control_center_items=(
    ["Bluetooth"]="18"
    ["WiFi"]="18"
    ["AirDrop"]="18"
    ["Focus"]="18"
    ["StageManager"]="18"
    ["Display"]="18"
    ["Sound"]="18"
    ["NowPlaying"]="18"
    ["ScreenMirroring"]="18"
    ["Battery"]="18"
    ["Clock"]="18"
    ["UserSwitcher"]="18"
)

# Function to configure Control Center item
configure_control_center_item() {
    local item="$1"
    local value="$2"
    local action="$3"
    
    launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost write com.apple.controlcenter.plist "$item" -int "$value"
    
    if [ "$value" = "18" ]; then
        echo "✅ $item: Enabled in status bar"
    else
        echo "❌ $item: Disabled in status bar"
    fi
}

# Function to show all Control Center items
show_all_items() {
    echo "Enabling all Control Center items..."
    for item in "${!control_center_items[@]}"; do
        configure_control_center_item "$item" "18"
    done
}

# Function to hide all Control Center items
hide_all_items() {
    echo "Disabling all Control Center items..."
    for item in "${!control_center_items[@]}"; do
        configure_control_center_item "$item" "0"
    done
}

# Function to show current status of all items
show_current_status() {
    echo "Current Control Center Status:"
    echo "=============================="
    
    for item in "${!control_center_items[@]}"; do
        local current_value=$(launchctl asuser $CURRENT_USER_UID sudo -iu "$CURRENT_USER" defaults -currentHost read com.apple.controlcenter.plist "$item" 2>/dev/null)
        
        case "$current_value" in
            18) echo "✅ $item: Visible" ;;
            0) echo "❌ $item: Hidden" ;;
            *) echo "⚠️  $item: Not configured" ;;
        esac
    done
}

# Function to configure essential items only
configure_essential_items() {
    echo "Configuring essential Control Center items..."
    
    # Essential items for most users
    essential_items=("Bluetooth" "WiFi" "Sound" "Battery" "Clock")
    
    # Hide all items first
    hide_all_items
    
    # Show only essential items
    for item in "${essential_items[@]}"; do
        configure_control_center_item "$item" "18"
    done
}

# Main menu
echo "MacFleet Control Center Manager"
echo "==============================="
echo "Device: $(scutil --get ComputerName)"
echo "User: $CURRENT_USER"
echo ""

show_current_status

echo ""
echo "Management Options:"
echo "1. Show all Control Center items"
echo "2. Hide all Control Center items"
echo "3. Show essential items only"
echo "4. Show only Bluetooth menu"
echo "5. Hide only Bluetooth menu"
echo "6. Check current status"
echo ""

read -p "Enter your choice (1-6): " choice

case $choice in
    1) show_all_items ;;
    2) hide_all_items ;;
    3) configure_essential_items ;;
    4) configure_control_center_item "Bluetooth" "18" ;;
    5) configure_control_center_item "Bluetooth" "0" ;;
    6) show_current_status ;;
    *) echo "Invalid choice. Please run the script again." ;;
esac

echo ""
echo "Configuration completed. Changes may require logout/login to take full effect."

Enterprise Deployment Scripts

Bulk Bluetooth Menu Configuration

#!/bin/bash

# Bulk Bluetooth menu configuration for enterprise deployment
COMPANY_NAME="MacFleet"
DEPLOYMENT_DATE=$(date +"%Y-%m-%d")
LOG_FILE="/var/log/macfleet_bluetooth_deployment.log"
REPORT_FILE="/tmp/bluetooth_deployment_report_$(date +%Y%m%d_%H%M%S).txt"

# Configuration settings
BLUETOOTH_ENABLED=true  # Set to false to disable
FORCE_RESTART_CONTROL_CENTER=true

# Function to log messages
log_message() {
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
}

# Function to get device information
get_device_info() {
    local device_name=$(scutil --get ComputerName)
    local device_serial=$(system_profiler SPHardwareDataType | grep "Serial Number" | awk '{print $4}')
    local macos_version=$(sw_vers -productVersion)
    local current_user=$(ls -l /dev/console | awk '/ / { print $3 }')
    
    echo "Device: $device_name"
    echo "Serial: $device_serial"
    echo "macOS: $macos_version"
    echo "User: $current_user"
}

# Function to configure Bluetooth menu
configure_bluetooth_menu() {
    local enable_bluetooth="$1"
    local current_user=$(ls -l /dev/console | awk '/ / { print $3 }')
    local current_user_uid=$(id -u "$current_user")
    
    if [ "$enable_bluetooth" = true ]; then
        launchctl asuser $current_user_uid sudo -iu "$current_user" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18
        log_message "Bluetooth menu enabled for user $current_user"
        echo "✅ Bluetooth menu enabled"
    else
        launchctl asuser $current_user_uid sudo -iu "$current_user" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 0
        log_message "Bluetooth menu disabled for user $current_user"
        echo "❌ Bluetooth menu disabled"
    fi
}

# Function to restart Control Center
restart_control_center() {
    local current_user=$(ls -l /dev/console | awk '/ / { print $3 }')
    local current_user_uid=$(id -u "$current_user")
    
    # Kill Control Center process to force reload
    launchctl asuser $current_user_uid sudo -iu "$current_user" killall ControlCenter 2>/dev/null
    log_message "Control Center restarted for user $current_user"
}

# Function to validate deployment
validate_deployment() {
    local current_user=$(ls -l /dev/console | awk '/ / { print $3 }')
    local current_user_uid=$(id -u "$current_user")
    local bluetooth_status=$(launchctl asuser $current_user_uid sudo -iu "$current_user" defaults -currentHost read com.apple.controlcenter.plist Bluetooth 2>/dev/null)
    
    if [ "$BLUETOOTH_ENABLED" = true ] && [ "$bluetooth_status" = "18" ]; then
        echo "✅ Deployment successful - Bluetooth menu is visible"
        log_message "Deployment validation successful"
        return 0
    elif [ "$BLUETOOTH_ENABLED" = false ] && [ "$bluetooth_status" = "0" ]; then
        echo "✅ Deployment successful - Bluetooth menu is hidden"
        log_message "Deployment validation successful"
        return 0
    else
        echo "❌ Deployment validation failed"
        log_message "Deployment validation failed - Expected: $BLUETOOTH_ENABLED, Got: $bluetooth_status"
        return 1
    fi
}

# Main deployment process
echo "$COMPANY_NAME Bluetooth Menu Deployment" > "$REPORT_FILE"
echo "=========================================" >> "$REPORT_FILE"
echo "Date: $DEPLOYMENT_DATE" >> "$REPORT_FILE"
echo "" >> "$REPORT_FILE"

get_device_info >> "$REPORT_FILE"
echo "" >> "$REPORT_FILE"

log_message "Starting Bluetooth menu deployment"
echo "Starting deployment..." >> "$REPORT_FILE"

# Configure Bluetooth menu
configure_bluetooth_menu $BLUETOOTH_ENABLED

# Restart Control Center if requested
if [ "$FORCE_RESTART_CONTROL_CENTER" = true ]; then
    restart_control_center
    sleep 2
fi

# Validate deployment
if validate_deployment; then
    echo "Status: SUCCESS" >> "$REPORT_FILE"
else
    echo "Status: FAILED" >> "$REPORT_FILE"
fi

log_message "Deployment completed"
echo "Deployment completed. Report saved to: $REPORT_FILE"
cat "$REPORT_FILE"

Remote Bluetooth Menu Management

#!/bin/bash

# Remote Bluetooth menu management with JSON reporting
CENTRAL_SERVER="your-macfleet-server.com"
DEVICE_ID=$(system_profiler SPHardwareDataType | grep "Serial Number" | awk '{print $4}')
REPORT_FILE="/tmp/bluetooth_menu_report_${DEVICE_ID}.json"

# Function to create JSON report
create_json_report() {
    local device_name=$(scutil --get ComputerName)
    local device_user=$(ls -l /dev/console | awk '/ / { print $3 }')
    local device_user_uid=$(id -u "$device_user")
    local os_version=$(sw_vers -productVersion)
    local timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
    
    # Get current Bluetooth menu status
    local bluetooth_status=$(launchctl asuser $device_user_uid sudo -iu "$device_user" defaults -currentHost read com.apple.controlcenter.plist Bluetooth 2>/dev/null)
    
    cat > "$REPORT_FILE" << EOF
{
  "device_info": {
    "device_id": "$DEVICE_ID",
    "device_name": "$device_name",
    "user": "$device_user",
    "os_version": "$os_version",
    "timestamp": "$timestamp"
  },
  "bluetooth_menu": {
    "status": "$bluetooth_status",
    "visible": $([ "$bluetooth_status" = "18" ] && echo "true" || echo "false"),
    "configured": $([ -n "$bluetooth_status" ] && echo "true" || echo "false")
  },
  "control_center": {
    "items": {
EOF

    # Check other Control Center items
    local items=("WiFi" "AirDrop" "Focus" "Display" "Sound" "NowPlaying" "Battery" "Clock")
    local first_item=true
    
    for item in "${items[@]}"; do
        local item_status=$(launchctl asuser $device_user_uid sudo -iu "$device_user" defaults -currentHost read com.apple.controlcenter.plist "$item" 2>/dev/null)
        
        if [ "$first_item" = false ]; then
            echo "," >> "$REPORT_FILE"
        fi
        
        echo "      \"$item\": {" >> "$REPORT_FILE"
        echo "        \"status\": \"$item_status\"," >> "$REPORT_FILE"
        echo "        \"visible\": $([ "$item_status" = "18" ] && echo "true" || echo "false")" >> "$REPORT_FILE"
        echo "      }" >> "$REPORT_FILE"
        
        first_item=false
    done
    
    echo "" >> "$REPORT_FILE"
    echo "    }" >> "$REPORT_FILE"
    echo "  }" >> "$REPORT_FILE"
    echo "}" >> "$REPORT_FILE"
}

# Function to apply configuration from server
apply_server_config() {
    local config_url="https://$CENTRAL_SERVER/api/device-config/$DEVICE_ID"
    
    # Download configuration (example)
    # curl -s "$config_url" -o "/tmp/device_config.json"
    
    # For demonstration, we'll use a local example
    echo "Applying server configuration..."
    
    # Example: Enable Bluetooth menu
    local current_user=$(ls -l /dev/console | awk '/ / { print $3 }')
    local current_user_uid=$(id -u "$current_user")
    
    launchctl asuser $current_user_uid sudo -iu "$current_user" defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18
    
    echo "Server configuration applied successfully"
}

# Main execution
echo "MacFleet Remote Bluetooth Menu Management"
echo "========================================"
echo "Device ID: $DEVICE_ID"

# Create initial report
create_json_report

# Display current status
echo "Current Bluetooth menu status: $(grep -o '"visible": [^,]*' "$REPORT_FILE" | head -1 | cut -d' ' -f2)"

# Apply server configuration if needed
# apply_server_config

# Create final report
create_json_report

echo "Report generated: $REPORT_FILE"
echo "Device reporting completed"

# Optional: Send to central server
# curl -X POST -H "Content-Type: application/json" -d @"$REPORT_FILE" "https://$CENTRAL_SERVER/api/device-reports"

Best Practices for Status Bar Management

1. User Experience Considerations

  • Maintain consistent status bar layouts across all devices
  • Provide essential tools while avoiding clutter
  • Consider user workflow requirements

2. Deployment Strategy

  • Test configuration changes on a small group first
  • Document standard configurations for different user types
  • Provide rollback procedures

3. Change Management

  • Notify users of interface changes in advance
  • Provide training materials for new configurations
  • Monitor support requests after changes

4. Monitoring and Maintenance

  • Regular audits of status bar configurations
  • Automated compliance checking
  • User feedback collection

Troubleshooting Common Issues

Issue: Changes Not Taking Effect

# Force Control Center restart
killall ControlCenter
sleep 2

# Check if preferences are properly written
defaults -currentHost read com.apple.controlcenter.plist Bluetooth

Issue: Permission Denied

# Verify user context
current_user=$(ls -l /dev/console | awk '/ / { print $3 }')
echo "Current user: $current_user"

# Check user permissions
id "$current_user"

Issue: macOS Version Compatibility

# Check macOS version
macos_version=$(sw_vers -productVersion)
echo "macOS version: $macos_version"

# For macOS 12.0 and below, use different preference location
if [[ "$macos_version" < "12.0" ]]; then
    echo "Using legacy preferences location"
    # Use different defaults domain for older versions
fi

Issue: Preferences Not Persisting

# Force preferences synchronization
defaults -currentHost synchronize

# Check if preferences file exists
ls -la ~/Library/Preferences/ByHost/com.apple.controlcenter.*

Conclusion

Managing Bluetooth menu visibility in the status bar is a simple but effective way to standardize the user experience across your Mac fleet. These scripts provide:

  • Consistent interface: Standardized status bar layouts
  • Remote management: Centralized control over UI elements
  • User productivity: Quick access to essential controls
  • Enterprise compliance: Maintaining organizational standards

Regular implementation of these status bar management practices will help ensure a consistent and productive user experience across your entire Mac fleet.

For more advanced Control Center management, consider integrating these scripts with your existing device management and configuration tools.

Tutorial

Novas atualizações e melhorias para a Macfleet.

Configurando um Runner do GitHub Actions em um Mac Mini (Apple Silicon)

Runner do GitHub Actions

GitHub Actions é uma plataforma poderosa de CI/CD que permite automatizar seus fluxos de trabalho de desenvolvimento de software. Embora o GitHub ofereça runners hospedados, runners auto-hospedados fornecem maior controle e personalização para sua configuração de CI/CD. Este tutorial o guia através da configuração e conexão de um runner auto-hospedado em um Mac mini para executar pipelines do macOS.

Pré-requisitos

Antes de começar, certifique-se de ter:

  • Um Mac mini (registre-se no Macfleet)
  • Um repositório GitHub com direitos de administrador
  • Um gerenciador de pacotes instalado (preferencialmente Homebrew)
  • Git instalado em seu sistema

Passo 1: Criar uma Conta de Usuário Dedicada

Primeiro, crie uma conta de usuário dedicada para o runner do GitHub Actions:

# Criar a conta de usuário 'gh-runner'
sudo dscl . -create /Users/gh-runner
sudo dscl . -create /Users/gh-runner UserShell /bin/bash
sudo dscl . -create /Users/gh-runner RealName "GitHub runner"
sudo dscl . -create /Users/gh-runner UniqueID "1001"
sudo dscl . -create /Users/gh-runner PrimaryGroupID 20
sudo dscl . -create /Users/gh-runner NFSHomeDirectory /Users/gh-runner

# Definir a senha para o usuário
sudo dscl . -passwd /Users/gh-runner sua_senha

# Adicionar 'gh-runner' ao grupo 'admin'
sudo dscl . -append /Groups/admin GroupMembership gh-runner

Mude para a nova conta de usuário:

su gh-runner

Passo 2: Instalar Software Necessário

Instale Git e Rosetta 2 (se estiver usando Apple Silicon):

# Instalar Git se ainda não estiver instalado
brew install git

# Instalar Rosetta 2 para Macs Apple Silicon
softwareupdate --install-rosetta

Passo 3: Configurar o Runner do GitHub Actions

  1. Vá para seu repositório GitHub
  2. Navegue para Configurações > Actions > Runners

Runner do GitHub Actions

  1. Clique em "New self-hosted runner" (https://github.com/<username>/<repository>/settings/actions/runners/new)
  2. Selecione macOS como imagem do runner e ARM64 como arquitetura
  3. Siga os comandos fornecidos para baixar e configurar o runner

Runner do GitHub Actions

Crie um arquivo .env no diretório _work do runner:

# arquivo _work/.env
ImageOS=macos15
XCODE_15_DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
  1. Execute o script run.sh em seu diretório do runner para completar a configuração.
  2. Verifique se o runner está ativo e ouvindo por trabalhos no terminal e verifique as configurações do repositório GitHub para a associação do runner e status Idle.

Runner do GitHub Actions

Passo 4: Configurar Sudoers (Opcional)

Se suas ações requerem privilégios de root, configure o arquivo sudoers:

sudo visudo

Adicione a seguinte linha:

gh-runner ALL=(ALL) NOPASSWD: ALL

Passo 5: Usar o Runner em Fluxos de Trabalho

Configure seu fluxo de trabalho do GitHub Actions para usar o runner auto-hospedado:

name: Fluxo de trabalho de exemplo

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: [self-hosted, macOS, ARM64]
    steps:
      - name: Instalar NodeJS
        run: brew install node

O runner está autenticado em seu repositório e rotulado com self-hosted, macOS, e ARM64. Use-o em seus fluxos de trabalho especificando estes rótulos no campo runs-on:

runs-on: [self-hosted, macOS, ARM64]

Melhores Práticas

  • Mantenha seu software do runner atualizado
  • Monitore regularmente os logs do runner para problemas
  • Use rótulos específicos para diferentes tipos de runners
  • Implemente medidas de segurança adequadas
  • Considere usar múltiplos runners para balanceamento de carga

Solução de Problemas

Problemas comuns e soluções:

  1. Runner não conectando:

    • Verifique conectividade de rede
    • Verifique validade do token GitHub
    • Certifique-se de permissões adequadas
  2. Falhas de build:

    • Verifique instalação do Xcode
    • Verifique dependências necessárias
    • Revise logs do fluxo de trabalho
  3. Problemas de permissão:

    • Verifique permissões do usuário
    • Verifique configuração sudoers
    • Revise permissões do sistema de arquivos

Conclusão

Agora você tem um runner auto-hospedado do GitHub Actions configurado em seu Mac mini. Esta configuração fornece mais controle sobre seu ambiente CI/CD e permite executar fluxos de trabalho específicos do macOS de forma eficiente.

Lembre-se de manter regularmente seu runner e mantê-lo atualizado com os patches de segurança e versões de software mais recentes.

Aplicativo Nativo

Aplicativo nativo do Macfleet

Guia de Instalação do Macfleet

Macfleet é uma solução poderosa de gerenciamento de frota projetada especificamente para ambientes Mac Mini hospedados na nuvem. Como provedor de hospedagem na nuvem Mac Mini, você pode usar o Macfleet para monitorar, gerenciar e otimizar toda sua frota de instâncias Mac virtualizadas.

Este guia de instalação o conduzirá através da configuração do monitoramento do Macfleet em sistemas macOS, Windows e Linux para garantir supervisão abrangente de sua infraestrutura na nuvem.

🍎 macOS

  • Baixe o arquivo .dmg para Mac aqui
  • Clique duas vezes no arquivo .dmg baixado
  • Arraste o aplicativo Macfleet para a pasta Aplicativos
  • Ejete o arquivo .dmg
  • Abra Preferências do Sistema > Segurança e Privacidade
    • Aba Privacidade > Acessibilidade
    • Marque Macfleet para permitir monitoramento
  • Inicie o Macfleet a partir de Aplicativos
  • O rastreamento inicia automaticamente

🪟 Windows

  • Baixe o arquivo .exe para Windows aqui
  • Clique com o botão direito no arquivo .exe > "Executar como administrador"
  • Siga o assistente de instalação
  • Aceite os termos e condições
  • Permita no Windows Defender se solicitado
  • Conceda permissões de monitoramento de aplicativo
  • Inicie o Macfleet a partir do Menu Iniciar
  • O aplicativo começa o rastreamento automaticamente

🐧 Linux

  • Baixe o pacote .deb (Ubuntu/Debian) ou .rpm (CentOS/RHEL) aqui
  • Instale usando seu gerenciador de pacotes
    • Ubuntu/Debian: sudo dpkg -i Macfleet-linux.deb
    • CentOS/RHEL: sudo rpm -ivh Macfleet-linux.rpm
  • Permita permissões de acesso X11 se solicitado
  • Adicione o usuário aos grupos apropriados se necessário
  • Inicie o Macfleet a partir do menu Aplicativos
  • O aplicativo começa o rastreamento automaticamente

Nota: Após a instalação em todos os sistemas, faça login com suas credenciais do Macfleet para sincronizar dados com seu painel de controle.