Archive for September 25, 2015

Friday, September 25, 2015

FBSimulatorControl

Facebook (via Peter Steinberger):

The original use-case for FBSimulatorControl was to boot Simulators to run End-to-End tests with WebDriverAgent. As FBSimulatorControl is a Mac OS X framework, it can be linked to from inside any Mac OS Library, Application, or xctest target. There may be additional use-cases that you may find beyond UI Test Automation.

FBSimulatorControl works by linking with the private DVTFoundation, CoreSimulator and DVTiPhoneSimulatorRemoteClient frameworks that are present inside the Xcode bundle. Doing this allows FBSimulatorControl to talk directly to the same APIs that Xcode and simctl do. This, combined with launching the Simulator binaries directly, means that multiple Simulators can be launched simultaneously. Test targets can be made that don’t depend on any Application targets, or that launch multiple Application targets. This enables running against pre-built and archived Application binaries, rather than a binary that is built by a Test Target.

Swizzling With Swift

Sash Zats:

Another issue I’ve yet to mention is how to call the original implementation. In this case, I had no desire to figure out how to re-implement the function, so we have to call the original implementation, and retain the returning object on top. This is a problem with Swift 1.2: you cannot call C functions just through their pointer. To be clear, you can call C functions from Swift, but you cannot obtain pointers to functions using other tools and call the function through its pointer like you would do in Objective-C.

As a result, this part has to be implemented in Objective-C. I am not proud about it, but that’s what we have to do for now.

Swift 2 does support calling C function pointers.

DirectLinks Safari Extension

John Gruber (tweet):

If you’ve ever tried dragging-and-dropping a URL from Google search results and getting a Google redirection URL instead of the actual URL you wanted (and Google’s JavaScript will show the actual URL in the status field if you hover over the link, so it’s impossible to tell that’s what’s going to happen), this extension is for you. There are obvious privacy benefits as well.

Using Xcode Targets

Sam Marshall:

Source files must be added to all the framework targets by hand, same goes for any new files you add. Since this is very easy to miss doing from the new file dialog, it is generally discouraged to add the same file to multiple targets (if what the targets are building are not significantly different). You not only have to maintain the code for the frameworks individually, but also all the build settings for them. This plus adding tests for all the targets quickly becomes an unreasonable goal to set for any development team without breaking all the frameworks into separate entities -- and away from a singular code-base.

[…]

While changing anything in a working build system is a risk, there are some big benefits you get for using xcconfig files instead of build settings stored on the project file.

[…]

A scheme can specify a single build configuration to be used for multiple targets. This means that instead of having schemes for each framework and then each application target, you can have a single scheme that tells a single framework target to be built using a specific configuration and associated xcconfig file (you can set this up to be able to change the requirements of building based on target OS, so a single target could build for iOS, Mac, watchOS, and tvOS) before building the application target. Doing this means cutting the footprint of your code down significantly as well as removing the complexity of managing multiple targets.

Which iOS Content Blocker is the Fastest?

Ben Brooks:

When I tried with all blockers on, I did not get the performance of the fastest blocker, and instead got performance on the slower side of the blockers tested. It is my recommendation that you only use one blocker at a time.

[…]

As you can see, 1Blocker is the winner. It was (on average) 61.83% faster than having nothing turned on at all. That’s staggering. The worst of the lot seems to be Vivio, which was marginally faster than simply just turning on ‘Do Not Track’ in your browser settings.

1Blocker is also highly configurable as well. If you want something on the simple end of things, which makes decisions for you to unblock ads from places like The Deck, Adamant is a great option. It was the third fastest overall, and is trying to support the indie sites ad revenue the best it can.

iOS 9 Adds Wi-Fi Assist

Casey Liss:

Wi-Fi Assist allows for your phone to more aggressively fall back to using its onboard cellular connection in case the Wi-Fi it is connected to doesn’t respond in a timely fashion. While dangerous for some with small data plans, for those with some breathing room, this is a fantastic addition.

Update (2015-10-04): Mark Pygas:

If you’re on a limited data plan, that’s bad news.

Slashdot:

That's helpful if you're in the middle of watching a video or some other task on the internet that you don't want interrupted by spotty Wi-Fi service. Unfortunately, Wi-Fi Assist is enabled by default, which means that users may exceed their data cap without knowing it because their phone is silently switching their data connection from Wi-Fi to cellular.

Update (2015-10-14): Dan Moren:

So, yes, it’s still possible for Wi-Fi Assist to chew through your data, but it seems like Apple’s identified the key spots where that might really be dangerous and preemptively moved to address them.