Skip to content

Instantly share code, notes, and snippets.

@atabekm
atabekm / restart-ios-simulator.md
Last active April 1, 2023 02:21
Restart iOS simulator on each Xcode run (workaround for Xcode 14.x Simulators frequent turning blank black screen)

Problem: With Xcode 14.x, Simulators sometimes turn to blank black screen, and the only fix is to restart it. The following solution helps to do it automatically.

  1. Create a file quit_simulator.sh
#!/bin/bash

osascript <<EOF &
tell application "Simulator"
// Start recording video (`Ctrl + C` to stop)
adb shell screenrecord /sdcard/video.mp4
// Download the video
adb pull /sdcard/video.mp4 ~/Desktop
// Convert mp4 to gif
ffmpeg -i ~/Desktop/video.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" ~/Desktop/video.gif
Preferences... -> Editor -> Color Scheme -> Android Logcat
Assert -> #AA66CC
Debug -> #33B5E5
Error -> #FF4444
Info -> #99CC00
Verbose -> #BBBBBB (default color)
Warning -> #FFBB33
@atabekm
atabekm / LogInterface.java
Last active March 21, 2018 11:20
Learning unit testing
package com.sample;
public interface LogInterface {
void log(String message);
}
@atabekm
atabekm / README.md
Created June 17, 2016 12:15 — forked from polbins/README.md
Simple RecyclerView Divider

Simple RecyclerView Divider

Simple Horizontal Divider Item Decoration for RecyclerView

    mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
            getApplicationContext()
    	));

NOTE: Add item decoration prior to setting the adapter