KISS

Keep It Simple Stupid

Cannot type password on the screensaver screen in OS X 10.14

| comments

A small note about an annoying bug I encountered about a year ago.

I think this was new to OS X 10.14. When I locked the screen (using Caps Lock+S that ran a service to launch screen saver from the command line, where Caps Lock is mapped to Cmd+Ctrl+Opt+Shift with Karabiner-Elements; yes, it’s that complicated on OSX, there is no system shortcut to launch screen saver) and sometimes the password field couldn’t be focused, I couldn’t type anything. No key combinations or hot corners worked. The mouse cursor flickered when I moved it, it wanted to hide all the time, but moving made it visible. And this happened pretty often, a couple times a week on average.

It might have been an issue with XScreensavers; I didn’t use other screensavers at the time, so I don’t know if they had the same issue.

Removing ClearcutUploader errors when using GMaps iOS SDK

| comments

I worked on an iOS application that used the Google Maps SDK and noticed a bunch of logging when I backgrounded the application complaining that it couldn’t connect to some server:

1
2
3
4
5
6
7
8
9
2021-04-17 00:42:48.543716+0300 MyApp[73170:12130630] [connection] nw_socket_connect [C7.1:3] connect failed (fd 23) [64: Host is down]
2021-04-17 00:42:48.543851+0300 MyApp[73170:12130630] [] nw_socket_connect connect failed [64: Host is down]
2021-04-17 00:42:48.545236+0300 MyApp[73170:12130630] Connection 7: received failure notification
2021-04-17 00:42:48.545564+0300 MyApp[73170:12130630] Connection 7: failed to connect 1:64, reason -1
2021-04-17 00:42:48.545708+0300 MyApp[73170:12130630] Connection 7: encountered error(1:64)
2021-04-17 00:42:48.548091+0300 MyApp[73170:12130630] Task <170493E8-F704-4578-AB47-7B9CE76064B1>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:64])
2021-04-17 00:42:48.951902+0300 MyApp[73170:12128623] Task <170493E8-F704-4578-AB47-7B9CE76064B1>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=64, NSUnderlyingError=0x600003ccb360 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=64, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <170493E8-F704-4578-AB47-7B9CE76064B1>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <170493E8-F704-4578-AB47-7B9CE76064B1>.<1>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://play.googleapis.com/log/batch, NSErrorFailingURLKey=https://play.googleapis.com/log/batch, _kCFStreamErrorDomainKey=1}

And this is just one instance of it; typically it would be repeated a dozen times.

/sdcard “Permission denied” on Android

| comments

I’ve found some old notes about rooting a Motorola G4 Android phone and a puzzling issue I stumbled upon then. It may be useful to someone even though I couldn’t reproduce it now and don’t remember all the details.

I had a Moto G4 phone and it’s possible to officially unlock its bootloader in order to root it, remove some preinstalled (goog’s) crap and possibly install another firmware (Android is notoriously bad with software updates, Motorola was not very bad, they had occasional security updates). I followed one of the unlocking and rooting guides online: backed up as much stuff as I could (which is not much on a non-rooted phone), unlocked the bootloader by getting a code from Motorola, replaced the boot image, flashed TWRP, installed SuperSU, and replaced the kernel with ElementalX G4 because something didn’t work with the stock one.

Then I installed ABBYY Lingvo in the new system, but it was crashing on startup. I discovered that its directory on the internal storage (which I believe was in /sdcard/Android/) was empty and was trying to adb push it from the backup, but got “permission denied”. In fact, I couldn’t create any directory on /sdcard/. The permissions and owner on the directory were correct. Searching online didn’t find a solution, I tried a number of things, even editing platform.xml to change a setting. However when I booted into TWRP, I could write files to SD card fine.

Segregating useless built-in OS X applications

| comments

OS X is a nice and (mostly) stable operating system overall. However Apple puts so much crap and junk that may not be for everyone and that cannot be officially uninstalled. There is a bunch of standard applications and there is also a lot of standard daemons, some of which are trying to get network access to contact Apple (keyboardservicesd, studentd, seriously?!).

I don’t like having unnecessary stuff in my system and would prefer to get rid of it. I’m not sure about removing built-in applications completely, unfortunately that may have bad consequences to the stability of the system. But at least when I open the /Applications/ directory, I don’t want to see them. So a simple solution is to move them to /Applications/junk/.

The set of applications that are useless (junk) for you is your personal choice. For example: FaceTime, Home, Messages, News, Photo Booth, Siri, Stickies, Stocks. This post is how to move them away.

A few tips about Xcode’s Instruments

| comments

Time Profiler in Instruments (along with other instruments) is a great tool for profiling iOS application. It has a number of options, which are not described anywhere. The official documentation only touches the surface of Instruments; there is more information in WWDC videos, but it’s not quickly accessible in that form. Here’s a short list of findings that I inferred myself:

Xcode’s Instruments doesn’t show symbolicated stacktraces

| comments

Xcode’s Instruments is a very useful tool to profile and analyze iOS applications. For example, you can use the Time Profiler instrument to figure out which functions use the most CPU time: you see all the captured stacktraces with the number of samples for each function in the bottom half of the Instruments window. The list is supposed to show symbolicated stacktraces, that is actual function names like UIViewController.viewDidLoad() instead of their addresses in memory like 0x10c100f87, and this works most of the time until you change something and it breaks.

Keyboards on the iOS lock screen

| comments

Apple’s iOS is definitely a user-centric mobile operation system (for regular users, not so much for geeks and hackers). Its thoughtfulness also goes beyond the UI as I’ve discovered an interesting feature about the keyboards on the lock screen.