Search code examples
iosswiftapple-watchwatchos

SandboxViolation: WatchOS app crashes when running on device


I have an app for watchOS 3 that works perfectly fine and doesn't really do much. But when I try to launch and debug it on a real device the app crashes and the console logs this:

SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/*Identifier*/*appname*/Frameworks/libswiftos.dylib

I honestly have no clue what is going wrong. I remember it to work before but then on one point it stopped (can't remember changing anything relevant)


Solution

  • In my case the solution was that the Watch app took too long to launch. I deleted all upfront initialisation and found out that it was somehow too much (In fact I wasn't doing that much but initialising a picker with images from an extension which took too much time).

    After optimising this it worked as expected!