How to easily move iOS Simulator data files after Xcode upgrade

If you maintain an app like ConnectStats that has a lot of local files on the device and does not rely on the cloud constantly for input, each time Xcode upgrade all the iOS Simulator starts empty again and loose all the files from the previous version.

The iOS simulator keep it’s file in some complicated folder structure and the folder change each time you start it, so it can be quite tricky to locate the files. And so quite painful to locate all the folder for the previous and new version and move all the files over.

I’ll go over the solution I use in this post, using a small cli tool I wrote

Continue reading

Swift Package for Fit File Parsing

Garmin sends ConnectStats all the data as Fit Files, so I had built a library to parse it for the app. I used the code from the official Fit SDK. Originally I used the c++ implementation provided in the SDK as it was providing a way to get all the data pretty generically. The SDK while quite generic was actually quite slow in parsing.

About 2 years ago, as I wanted to get ConnectStats to get the extra information from the fit file and parse them systematically for each activity, the speed started to become an issue. So I wrote a new library in swift based on the c implementation of the SDK.

That ended up much faster than the previous version, and ConnectStats has been using it for a while, as well as FitFileExplorer which is a tool I wrote to see the raw fit files.

While I had provided that library on GitHub and it was open source, it wasn’t really easy to integrated into another app. Following a request last week, I investigated how to make it a Swift Package which I wasn’t really aware of. Always a good challenge to learn something new!

Continue reading

Home Networking Adventure

One of the requirement for me in finding a new house was to make sure it had ethernet cabling everywhere so I could ensure I have a stable network and enough access point to get good wifi connectivity in every room.

When I moved into a new place in August 2016, it met the requirement, but to my and my family dismay, the network and wifi stability was dreadful. It consistently would stall time and time over again. Streaming movies or music want halt for minutes at a time, and reading news on the web would also randomly hang.

I embarked on a long journey to try to resolve the issue, which would lead me to learn way more about networking that I ever imagined possible…

Continue reading