-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_macos.sh
More file actions
56 lines (48 loc) 路 2.07 KB
/
Copy pathbuild_macos.sh
File metadata and controls
56 lines (48 loc) 路 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Build script for macOS .app bundle using PyInstaller
echo "========================================"
echo " Network Logging Monitor - Build Script"
echo " Building macOS .app with PyInstaller"
echo "========================================"
echo ""
# Check if PyInstaller is installed
python3 -c "import PyInstaller" 2>/dev/null
if [ $? -ne 0 ]; then
echo "[ERROR] PyInstaller not found!"
echo "Please install it first: pip install pyinstaller"
exit 1
fi
echo "[1/4] Cleaning previous builds..."
rm -rf build dist __pycache__
echo "[2/4] Building application..."
pyinstaller --clean network_logging_gui.spec
if [ $? -ne 0 ]; then
echo "[ERROR] Build failed!"
exit 1
fi
echo "[3/4] Copying additional files to app bundle..."
if [ -d "dist/NetworkLoggingMonitor.app" ]; then
cp config.json dist/NetworkLoggingMonitor.app/Contents/MacOS/ 2>/dev/null || true
cp README.md dist/NetworkLoggingMonitor.app/Contents/MacOS/ 2>/dev/null || true
cp LICENSE dist/NetworkLoggingMonitor.app/Contents/MacOS/ 2>/dev/null || true
mkdir -p dist/NetworkLoggingMonitor.app/Contents/MacOS/logs
mkdir -p dist/NetworkLoggingMonitor.app/Contents/MacOS/setup_scripts
cp setup_macos_launchd.sh dist/NetworkLoggingMonitor.app/Contents/MacOS/setup_scripts/ 2>/dev/null || true
chmod +x dist/NetworkLoggingMonitor.app/Contents/MacOS/setup_scripts/setup_macos_launchd.sh 2>/dev/null || true
fi
echo "[4/4] Creating DMG (optional)..."
echo "Note: DMG creation requires additional tools (create-dmg or hdiutil)"
echo "Skipping DMG for now. App bundle is ready at: dist/NetworkLoggingMonitor.app"
echo ""
echo "========================================"
echo " Build successful!"
echo " Location: dist/NetworkLoggingMonitor.app"
echo " Size: ~20-40 MB (includes Python runtime)"
echo "========================================"
echo ""
echo "You can now run: open dist/NetworkLoggingMonitor.app"
echo "Or drag it to /Applications folder."
echo ""
echo "Note: macOS may block unsigned apps (Gatekeeper)."
echo "To allow: System Preferences > Security & Privacy > Open Anyway"
echo ""