สิทธิ์ Screen Recording (macOS)
macOS ต้องการสิทธิ์ Screen Recording ก่อนแอปจะแคปหน้าต่างอื่นได้
- แคปครั้งแรก macOS จะถามสิทธิ์
- เปิด System Settings → Privacy & Security → Screen Recording แล้วเปิดให้ maikap
- ปิดแล้วเปิด maikap ใหม่
สิทธิ์หายทุกครั้งที่ build
หัวข้อที่มีชื่อว่า “สิทธิ์หายทุกครั้งที่ build”macOS ผูกสิทธิ์ไว้กับ code signature ของแอป build แบบ ad-hoc จะเสียสิทธิ์ทุกครั้งที่ build ใหม่ (สวิตช์ดูเหมือนเปิดอยู่ แต่ภาพที่แคปมีแค่ wallpaper)
แก้โดยสร้าง certificate “MaiKap Dev” ไว้ในเครื่องครั้งเดียว แล้ว build-app.sh จะ sign ด้วยตัวนี้ให้สิทธิ์อยู่รอดข้าม build
scripts/make-signing-cert.shหลังเปลี่ยน signature ให้รีเซ็ตแล้วให้สิทธิ์ใหม่
tccutil reset ScreenCapture dev.bank20baht.maikapopen dist/maikap.app # กด New → อนุญาต → ปิดแล้วเปิดใหม่