소스 정보
- 저장소
- facebook/meta-wearables-dat-ios
- 최근 소스 활동
- 2026년 8월 3일 20:34
- 감지된 SKILL.md 언어
- 영어
- 스타
- 517
- 포크
- 118
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/facebook/meta-wearables-dat-ios --skill sample-app-guide명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | sample-app-guide |
| description | Building a complete DAT app with camera streaming and photo capture |
Build an iOS DAT app with camera streaming and photo capture.
This walkthrough covers app setup, registration, streaming, and capture. Pair it with the CameraAccess sample.
https://github.com/facebook/meta-wearables-dat-iosMWDATCore, MWDATCamera, and MWDATMockDevice to your targetInfo.plist (see Getting Started)A typical DAT app has these components:
MyDATApp/
├── MyDATApp.swift # App entry point, SDK init
├── ViewModels/
│ ├── WearablesViewModel.swift # Registration, device management
│ └── StreamViewModel.swift # Streaming, photo capture
└── Views/
├── MainAppView.swift # Navigation
├── RegistrationView.swift # Registration UI
└── StreamView.swift # Video preview, capture button
import MWDATCore
@main
struct MyDATApp: App {
init() {
do {
try Wearables.configure()
} catch {
assertionFailure("Wearables SDK configuration failed: \(error)")
}
}
var body: some Scene {
WindowGroup {
MainAppView()
.onOpenURL { url in
Task {
_ = try? await Wearables.shared.handleUrl(url)
}
}
}
}
}
import MWDATCore
@MainActor
class WearablesViewModel: ObservableObject {
@Published var registrationState: String = "Unknown"
@Published var devices: [DeviceIdentifier] = []
private let wearables = Wearables.shared
func observeState() {
Task {
for await state in wearables.registrationStateStream() {
self.registrationState = "\(state)"
}
}
Task {
for await devices in wearables.devicesStream() {
self.devices = devices.map { $0.identifier }
}
}
}
func register() async {
try? await wearables.startRegistration()
}
func unregister() async {
try? await wearables.startUnregistration()
}
}
import MWDATCamera
import MWDATCore
@MainActor
class StreamViewModel: ObservableObject {
@Published var currentFrame: UIImage?
@Published var streamState: String = "Stopped"
@Published var capturedPhoto: Data?
private let wearables = Wearables.shared
private var deviceSession: DeviceSession?
private var camera: Camera?
private var stream: Stream?
func startStream() async {
let config = StreamConfiguration(
videoCodec: .raw,
resolution: .medium,
frameRate: 24
)
let selector = AutoDeviceSelector(wearables: wearables)
do {
let deviceSession = try wearables.createSession(deviceSelector: selector)
try deviceSession.start()
// Wait for the device session to reach the started state
for await state deviceSession.stateStream() {
state .started { }
}
camera deviceSession.addCamera(config: config) { }
stream camera.stream
.deviceSession deviceSession
.camera camera
.stream stream
} {
}
stream { }
stream.statePublisher.listen { [ ] state
{
.streamState
}
}
stream.videoFramePublisher.listen { [ ] frame
image frame.makeUIImage() { }
{
.currentFrame image
}
}
stream.photoDataPublisher.listen { [ ] photoData
{
.capturedPhoto photoData.data
}
}
stream.start()
}
() {
camera.stop()
deviceSession.stop()
stream
camera
deviceSession
}
() {
stream.capturePhoto(format: .jpeg)
}
}
Add mock device support to develop without glasses:
import MWDATMockDevice
func setupMockDevice() async {
let mockDeviceKit = MockDeviceKit.shared
mockDeviceKit.enable()
guard let device = try? mockDeviceKit.pairGlasses(model: .rayBanMeta) else { return }
device.don()
if let videoURL = Bundle.main.url(forResource: "test_video", withExtension: "mov") {
let camera = device.services.camera
camera.setCameraFeed(fileURL: videoURL)
}
}
func tearDownMockDevice() {
MockDeviceKit.shared.disable()
}
Your DAT app should only depend on:
MWDATCore — always requiredMWDATCamera — for camera streamingMWDATMockDevice — for testing (can be test-only dependency)Stream, video frames, photo capture, resolution/frame rate configuration
Swift patterns, async/await, naming conventions, key types for DAT SDK iOS development
Common issues, Developer Mode, version compatibility, state machine diagnosis
SOC 직업 분류 기준