Wednesday, March 28, 2018

Android screen size and dpi

Often, when working on particular device, you need to find out exact screen dimensions and dpi:

uki  08:04 ~ $ adb shell dumpsys window displays | grep dpi
    init=1440x2880 560dpi base=1440x2880 476dpi cur=1440x2880 app=1440x2737 rng=1440x1357-2737x2654

Friday, March 16, 2018

Resizing Mac APFS disk to create a case-sensitive HFS (hfsx) for Linux sharing and Android builds

Resizing Mac APFS 500Gb to 350Gb and creating HFSx (case-sensitive) for AOSP building.

$ sudo diskutil apfs resizeContainer disk0s2 250g hfsx REPO 0b

Shrinking APFS Physical Store disk0s2 from 499,963,170,816 to 249,999,998,976 bytes
Shrinking APFS data structures

[ \ 0%..10%..20%..30%..40%............................... ] 47% 0:00:02 


Initialized /dev/rdisk0s3 as a 233 GB case-sensitive HFS Plus volume
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk0s3
Finished APFS operation
uki 13:16 ~ $ diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         500.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         250.0 GB   disk0s2
   3:                  Apple_HFS REPO                    249.8 GB   disk0s3

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +250.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume SYSTEM                  220.6 GB   disk1s1
   2:                APFS Volume Preboot                 22.3 MB    disk1s2
   3:                APFS Volume Recovery                509.8 MB   disk1s3

   4:                APFS Volume VM                      1.1 GB     disk1s4


Thursday, March 8, 2018

Mac case-sensitive

Mac, for some idiotic reason is not case sensitive anymore:

$ echo 'You should see this assigned to abc' > abc ; echo 'and not only this printed twice' > ABC ; cat  abc ABC
and not only this printed twice

and not only this printed twice

In order to work with source code I tried few things, such as USC-C SSD drive formated as case-sensitive, bu tit is too slow.

So I created a new case-sensitive APSF partition using DiskUtility.

$ cd /Volumes/REPO 
REPO $ echo 'You should see this assigned to abc' > abc ; echo 'and not only this printed twice' > ABC ; cat  abc ABC
You should see this assigned to abc
and not only this printed twice

Building and Installing Android AOSP

In these notes, I will document few things:

1) Building newest AOSP for the HiKey SBC
2) Installing new image in Android Studio Emulator
3) Installing Android Pie preview of Android "Tiamen" (a Siberian fish, the picture is shown below) on Pixel 2 XL.

General Info about the AOSP

read general info:

Preview Images

Android P (pie) image: 

Emulator running preview:

Factory Images

Android Oreo image 8.1.0 (OPM1.171019.021, Mar 2018):

Hikey960 binaries for Android 8.0.0 (20171017) ARM:

Hardware specific Binaries

Pixel 2 XL binaries for Android 8.1.0 (OPM1.171019.021)

Google (Vendor Image):

Qualcomm (GPS, Audio, Camera, Gestures, Graphics, DRM, Video, Sensors)

AOSP building

Reference AOSP Development Boards (e.g. HiKey)

$ git clone android-hikey-linaro

Wednesday, February 21, 2018

Mac Screenshots

To change the default saving location of Mac Screenshots (Desktop) you run the following in the Terminal, I also added the first command to ~/.bash_profile:

$ defaults write location ~/Screenshots

$ killall SystemUIServer

Tuesday, February 13, 2018

repo reset

Sometimes you have to get back to the pristine sync with your repo, I created a function in my ~/.bash_profile for that.

# REPO HEAD updated: February 13, 2018
function repo_reset()
source activate py27
cd ~/REPO/my-repo-name
#repo sync
repo forall -vc "git clean -xdf"
repo forall -vc "git reset --hard HEAD"
ls -alt

The "ls" command with sorting

The Mac/Unix "ls" command does not include sorting by file name. 

To get it done I added a new function in Bash to my ~/.bash_profile

# ls with sort - updated: February 13, 2018
function list()
    if [ "$1" != "" ]; then
        ls -a $1 | sort
    ls -a | sort

Monday, January 22, 2018

Building AOSP on Mac: Could not find a supported mac sdk: ["10.10" "10.11" "10.12"]

To build Android on MacBookPro High Sierra, I had to overcome few obstacles.
I looked up the MacOS SDK version, I am currently running:
$ ls /Applications/


$ edit build/soong/cc/config/x86_darwin_host.go

Then changed build/soong/cc/config/x86_darwin_host.go to:

line 92, add "10.13",
 darwinSupportedSdkVersions = []string{
Also, tried previous SDKs:
$ cd /Applications/

$ git clone

copy directories into:


uki 10:44 SDKs $ list





uki 10:44 SDKs $

Wednesday, January 3, 2018

Why developers should use Google Nexus / Pixel devices

It is January 2018. I sitting in front of two 2017 FLAGSHIP phones from Huawei and Samsung and the sample code app that I am trying will not run on neither of them (Android 7, API 24), but it does run on the Google Pixel C tablet that is 3 years old and discontinued but has been already updated to Android 8, API 26.

This really teaches me a lesson, get Pixel phone as a next phone.

Thursday, December 21, 2017

Missing xcrun on macOS High Sierra


xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

error: "" unsupported


  • Re-install XCode from App Store (~20 minutes)
    • Open XCode and agree to lice agreement
    • Allow it to "Instal components..."
This resolved my problem, but optionally you can try the following:
  • xcode-select --install
  • sudo xcodebuild -license
  • xcode-select --reset