debugging

โดย facebook

ปัญหาทั่วไป, โหมดนักพัฒนา, ความเข้ากันได้ของเวอร์ชัน, การวินิจฉัยสถานะเครื่อง

npx skills add https://github.com/facebook/meta-wearables-dat-ios --skill debugging

Debugging (iOS)

Diagnose common setup, registration, and streaming issues in DAT SDK integrations.

If local DAT Inspector MCP tools are available, use the live-debugging-mcp skill before changing app code. Prefer get_dat_readiness, get_companion_boundary_diagnosis, and get_device_path to separate app bugs from Meta AI app/device boundary issues using read-only DAT evidence.

Quick diagnosis

Device not connecting?
│
├── Is Developer Mode enabled? → Enable in Meta AI app settings
│
├── Is device registered? → Check registration state
│
├── Is device in range? → Bluetooth on, glasses powered on
│
├── Is the app registered? → Check registrationStateStream()
│
└── Stream stuck in waitingForDevice? → Check device availability

Developer Mode

Developer Mode must be enabled for 3P apps to access device features.

Enabling Developer Mode

  1. Open Meta AI app on phone
  2. Go to Settings → (Your connected glasses)
  3. Find "Developer Mode" toggle
  4. Toggle ON
  5. Device may restart

Symptoms of Developer Mode disabled

  • Registration completes but device never connects
  • Stream stuck in waitingForDevice
  • Permission requests fail or never appear

Watch for

  • Developer Mode toggles off after firmware updates — re-enable it
  • Developer Mode is per-device — enable for each glasses pair
  • Some features need additional permissions beyond Developer Mode

Stream state issues

Expected flow

stopped → waitingForDevice → starting → streaming → stopped

Stuck in waitingForDevice

  • Device not in range or not connected
  • Device not reporting availability
  • DeviceSelector not matching any device

Unexpected stop

  • Device disconnected (out of range, battery died)
  • Channel closed by device
  • Error in frame processing

Version compatibility

Ensure compatible versions of SDK, Meta AI app, and glasses firmware. See version dependencies for the current compatibility matrix.

Known issues

IssueWorkaround
No internet → registration failsInternet required for registration
Streams started with glasses doffed pause when donnedUnpause by tapping the side of the glasses
A single touchpad tap pauses an active streamTap again to resume; keep the last frame on screen while StreamState is .paused

See the public known issues page for the current list.

Adding debug logging

import os

private let logger = Logger(subsystem: "com.yourapp", category: "Wearables")

// In your streaming code:
logger.debug("Stream state changed to: \(state)")
logger.error("Stream error: \(error)")

Live MCP evidence

When the developer has a local DAT debug server connected to the agent:

  • Start with get_sdk_state and get_dat_readiness
  • Use get_companion_boundary_diagnosis for permission, app identity, device capability, device-selection, deeplink-return, and DAM/DWA-visible blockers
  • Use get_device_path to trace app -> DAT registration -> Meta AI app permissions -> device selection/link -> session -> stream
  • Ask the developer to reproduce the issue, then use wait_for_events with the narrowest category or source that matches the flow
  • Use export_diagnostic_bundle for redacted support handoff

Do not treat this as companion app introspection. It is diagnosis from app-visible DAT debug events.

Checklist

  • Developer Mode enabled in Meta AI app
  • Meta AI app updated to compatible version
  • Glasses firmware updated to compatible version
  • Internet connection available for registration
  • Bluetooth enabled on phone
  • Correct URL scheme configured in Info.plist, and MWDAT > AppLinkURLScheme matches it
  • URL callback handler forwards metaWearablesAction links to Wearables.shared.handleUrl(_:)
  • Background modes enabled (processing, bluetooth-central, bluetooth-peripheral, external-accessory)
  • UISupportedExternalAccessoryProtocols contains com.meta.ar.wearable
  • NSBluetoothAlwaysUsageDescription, NSLocalNetworkUsageDescription, and NSBonjourServices present

Links

Skills เพิ่มเติมจาก facebook

gc-safe-coding
facebook
สำหรับคำอธิบายและเหตุผลโดยละเอียด โปรดดูที่ doc/GCSafeCoding.md
app-review-prep
facebook
เตรียมแอป Meta สำหรับ App Review — ตรวจสอบสถานะปัจจุบัน ข้อกำหนดที่ค้างอยู่ สิทธิ์ที่ได้รับ และประวัติการส่ง ใช้ก่อนส่งแอป…
api-health
facebook
ตรวจสอบสุขภาพ API สำหรับแอป Meta — ตรวจสอบ rate limits, ปริมาณการเรียกใช้ และการเลิกใช้งาน API ใช้เพื่อวินิจฉัยการจำกัดการใช้งาน, วางแผนความจุ หรือเตรียมพร้อมสำหรับเวอร์ชัน API…
debug-webhooks
facebook
แก้ไขปัญหาเว็บฮุคสำหรับแอป Meta — ตรวจสอบการสมัครใช้งานที่ใช้งานอยู่ ระบุการตั้งค่าที่ผิดพลาด และส่งเพย์โหลดทดสอบเพื่อยืนยันการส่งมอบ ใช้เมื่อ…
api-integration
facebook
แนะนำนักพัฒนาในการตั้งค่าการเชื่อมต่อ Meta API ตั้งแต่เริ่มต้น — ค้นหา API ที่เหมาะสม ดึงคู่มือการตั้งค่า ข้อกำหนดการยืนยันตัวตน…
webhook-setup
facebook
ตั้งค่าเว็บฮุคสำหรับแอป Meta แบบครบวงจร — ค้นหาหัวข้อที่มีให้เลือก สมัครรับฟิลด์ และตรวจสอบด้วยเพย์โหลดทดสอบ ใช้เมื่อกำหนดค่าเว็บฮุคสำหรับ…
test-ui
facebook
ทดสอบระบบ UI (PanelUI, ScreenSpace) กับตัวอย่าง poke โดยใช้ iwsdk CLI
flags
facebook
ตรวจสอบและเปรียบเทียบสถานะฟีเจอร์แฟลกข้ามช่องทางการเผยแพร่ของ React ดูแฟลกทั้งหมดในทุกช่องทาง (www, www-modern, canary, next, experimental, rn variants) หรือเปรียบเทียบเฉพาะช่องทางด้วย --diff รูปแบบผลลัพธ์ประกอบด้วยมุมมองตารางเริ่มต้น, การส่งออก CSV, และการจัดกลุ่มสถานะการทำความสะอาด สถานะแฟลกแสดงด้วยสัญลักษณ์: เปิดใช้งาน (✅), ปิดใช้งาน (❌), ทดสอบรูปแบบต่างๆ (🧪), เฉพาะการทำโปรไฟล์ (📊) ข้อผิดพลาดทั่วไป: แฟลก __VARIANT__ ถูกทดสอบในทั้งสองสถานะบน www; ใช้ --diff เพื่อค้นหาความหมาย...