Open mmngreco opened 1 year ago
Thanks for reporting this and providing a solution -- I was puzzled by this error when I revisited my walking data and experienced this issues. I haven't tried the fix yet.
@simonw - maybe put in some error handling to trap for poorly formed XML (from Apple engineers) so that it suggests that there are problems with export.zip rather than odd looking Python errors :)
Hi @simonw
I hope you find this issue ok, the idea is provide some documentation to other users like me about how to solve this problem and save some time.
Following the instructions from the
README.md
I've faced this error:So, after debugging and searching on internet I found this useful link: https://discussions.apple.com/thread/254202523 (etresoft, the real hero). Which basically says that the xml given by the health app (healthkit version 12) has some bugs but fortunately, they can be solved with a couple of commads:
export.xml
is.Create a
patch.txt
with the following contentpatch < patch.txt
sed 's/startDate/endDate/2' export.xml > export-fixed.xml
healthkit-to-sqlite export-fixed.xml healthkit.db --xml