ADB Cheat Sheet

Get Device Info The device command gives you info about connected well devices $adb devices -l List of devices attached LGD8559ea73a60 device product:g3_global_com model:LG_D855 device:g3 transport_id:2 Shell $ adb shell Services shell@g3:/ $ service list Found 132 services: 0 AtCmdFwd: [com.qualcomm.atfwd.IAtCmdFwd] …   Device Properties shell@g3:/ $ getprop [DEVICE_PROVISIONED]: [1] … Get CPU information shell@g3:/…

How I learned to love the Bash

My tale of woe When I started to write my first ebook I decided to use pandoc to transform markdown into pdf. It basically looked like this pandoc metadata_de.yaml -o ./level_up_de.pdf –from markdown -V lang=de-DE level_up_de.md This simple command can be pasted into the command line everytime I want to build a new version of…

How to use an AVAudioPlayer in iOS with Swift 5

If you write an app that should play sound here is a snippet for you import AVFoundation var player: AVAudioPlayer? let url = Bundle.main.path(forResource: “richtig”, ofType: “wav”) do { try AVAudioSession.sharedInstance().setMode(.default) try AVAudioSession.sharedInstance().setActive(true, options: .notifyOthersOnDeactivation) guard let url = url else { return } player = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: url)) } catch { print(“Something went…

Play sound on Android

Motivation When writing app you sometimes want to play some sounds e.g. for notifications. In Android this can be accomplished by using the SoundPool class. Resource files Resource files e.g. your wav shall be placed under app\src\main\res\raw Code snippet This is a working example for playing short sound files. If you want to make a…

Android: Fix Unauthorized Devices on macOS

Disconnect USB connection between Mac/MacBook and Android device On the device: Revoke USB debugging authorization in Settings -> Developer Options cd /Users/<user_name>/Library/Android/sdk/platform-tools ./adb kill-server cd ~/.android/ rm -rf adbkey  Reconnect device Re-authorize computer to device cd /Users/<user_name>/Library/Android/sdk/platform-tools check with ./adb devices that device is authorized