[英]How do I run watch os app in the background
Hello Any one know how to run a CoreMotion startDeviceMotionUpdates in the background for long period of time I basically made a coreML model to detect hair pulling(trichotillomania) motion that all works great and all,您好任何人都知道如何在后台长时间运行 CoreMotion startDeviceMotionUpdates 我基本上制作了一个 coreML model 来检测头发拉动(拔毛癖),一切都很好,
but now I need it to run in the background even when the screen is dim and I don't just want it as a session, but basically running for ever.但现在我需要它在后台运行,即使屏幕很暗,我不只是希望它作为 session,而是基本上永远运行。 There is something called Extended Runtime Sessions but it does not really work it is limited for short time and wasn't able to get it to work anyways.
有一种叫做扩展运行时会话的东西,但它并没有真正起作用,它在短时间内受到限制,无论如何都无法让它工作。 https://developer.apple.com/documentation/watchkit/using_extended_runtime_sessions there doc are so vague and always have outdated samples.
https://developer.apple.com/documentation/watchkit/using_extended_runtime_sessions那里的文档非常模糊,并且总是有过时的样本。
Please any one know how to run a this in the background.请任何人知道如何在后台运行这个。 Thank you
谢谢
Not possible run application for long session in background for such task, you can just time to time awake application for ~10 seconds session every few hours.对于此类任务,不可能在后台长时间运行 session 应用程序,您可以每隔几个小时不时唤醒应用程序约 10 秒 session。
But, look at CMSensorRecorder, it's can recording all accelerometer data even application in background or inactive.但是,看看 CMSensorRecorder,它可以记录所有加速度计数据,即使是在后台或不活动的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.