# 🚨 Quick Fix for USB Printer Not Working

## What Changed ✅
Your app has been updated with:
1. **USB permissions** in config.xml
2. **Better error messages** to help diagnose problems
3. **Auto-diagnostics** that run when app starts
4. **Enhanced logging** for debugging

---

## 🎯 What to Do NOW

### **1. Rebuild the App**
```bash
cd "/Applications/XAMPP/xamppfiles/htdocs/Android Photo App"

# Option A: Debug build (faster for testing)
npm run cordova-build

# Option B: Release build (for production)
npm run cordova-build-apk
```

### **2. Enable USB Debugging on Phone**
1. Settings → About Phone
2. Tap "Build Number" 7 times
3. Settings → Developer Options → USB Debugging: ON
4. Plug in USB cable

### **3. Deploy to Phone**
```bash
# If you have adb installed:
adb install -r platforms/android/build/outputs/apk/debug/app-debug.apk

# Or manually:
# - Connect phone with USB
# - Open file manager
# - Copy app-debug.apk file to phone
# - Tap to install
```

### **4. Test the App**
1. Open app on phone
2. Select a photo
3. Click **"透過OS打印"** (Print via OS)
4. Printer dialog should appear
5. Select your Dai Nippon printer
6. Confirm print

---

## 🔍 If It Doesn't Work

### **Check Console Logs**
1. Connect phone to computer
2. Run: `adb logcat | grep -i print`
3. Look for error messages
4. Check if you see: "✅ Printer Plugin: true"

### **Common Issues & Fixes**

| Problem | Solution |
|---------|----------|
| USB printer not detected | Enable USB Debugging on phone |
| "Cannot connect to printer" | Check USB cable connection |
| "Printer plugin not available" | Run: `cordova plugin add cordova-plugin-printer@0.9.1` |
| Printer shows but print fails | Check printer is powered on |

---

## 📖 Full Documentation

See **USB_PRINTER_SETUP.md** for complete troubleshooting guide

