Run phone on monitor with keyboard and mouse
- plugin in phone to machine with cable
- terminal
@ scrcpy
- use phone on monitor with keyboard + mouse!!
Install SCRCPY with homebrew
I had already installed android studio on this machine – helps to take care of some parts
scrcpy
https://github.com/Genymobile/scrcpy
Install command:
Display and control your Android device
https://github.com/Genymobile/scrcpy
License: Apache-2.0
/api/formula/scrcpy.json
(JSON API)
/api/bottle/scrcpy.json
(Bottle JSON API)
Formula code on GitHub
Bottle (binary package) installation support provided for macOS releases:
Intel | Big Sur | ✅ |
---|---|---|
Catalina | ✅ | |
Mojave | ✅ | |
Apple Silicon | Big Sur | ✅ |
Current versions:
stable | ✅ | 1.19 |
Depends on:
ffmpeg | 4.4 | Play, record, convert, and stream audio and video |
sdl2 | 2.0.16 | Low-level access to audio, keyboard, mouse, joystick, and graphics |
Depends on when building from source:
meson | 0.59.1 | Fast and user friendly build system |
ninja | 1.10.2 | Small build system for use with gyp or CMake |
pkg-config | 0.29.2 | Manage compile and link flags for libraries |
At runtime, adb must be accessible from your PATH.
You can install adb from Homebrew Cask: |
NOTES::
brew install --cask homebrew/cask-versions/adoptopenjdk8
You may want to add to your profile:
'export ANDROID_NDK_HOME="/usr/local/share/android-ndk"'
Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting your PATH for example like so:
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
==> Downloading https://dl.google.com/android/repository/android-ndk-r22b-darwin-x86_64.zip
######################################################################## 100.0%
==> Installing Cask android-ndk
==> Linking Binary 'ndk_exec.sh' to '/usr/local/bin/ndk-build'
==> Linking Binary 'ndk_exec.sh' to '/usr/local/bin/ndk-depends'
==> Linking Binary 'ndk_exec.sh' to '/usr/local/bin/ndk-gdb'
==> Linking Binary 'ndk_exec.sh' to '/usr/local/bin/ndk-stack'
==> Linking Binary 'ndk_exec.sh' to '/usr/local/bin/ndk-which'
🍺 android-ndk was successfully installed!
~ ❯
==> Caveats
android-sdk requires Java 8. You can install it with:
brew install --cask homebrew/cask-versions/adoptopenjdk8
android-sdk has been officially discontinued upstream.
It may stop working correctly (or at all) in recent versions of macOS.
==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
######################################################################## 100.0%
==> Installing Cask android-sdk
==> Linking Binary 'android' to '/usr/local/bin/android'
==> Linking Binary 'emulator' to '/usr/local/bin/emulator'
==> Linking Binary 'emulator-check' to '/usr/local/bin/emulator-check'
==> Linking Binary 'mksdcard' to '/usr/local/bin/mksdcard'
==> Linking Binary 'monitor' to '/usr/local/bin/monitor'
==> Linking Binary 'apkanalyzer' to '/usr/local/bin/apkanalyzer'
==> Linking Binary 'archquery' to '/usr/local/bin/archquery'
==> Linking Binary 'avdmanager' to '/usr/local/bin/avdmanager'
==> Linking Binary 'jobb' to '/usr/local/bin/jobb'
==> Linking Binary 'lint' to '/usr/local/bin/lint'
==> Linking Binary 'monkeyrunner' to '/usr/local/bin/monkeyrunner'
==> Linking Binary 'screenshot2' to '/usr/local/bin/screenshot2'
==> Linking Binary 'sdkmanager' to '/usr/local/bin/sdkmanager'
==> Linking Binary 'uiautomatorviewer' to '/usr/local/bin/uiautomatorviewer'
🍺 android-sdk was successfully installed!
~ ❯ brew install android-ndk 2m 8s 12:10:06 AM
❯ brew install android-ndk
==> Caveats
You may want to add to your profile:
'export ANDROID_NDK_HOME="/usr/local/share/android-ndk"'
==> Downloading https://dl.google.com/android/repository/android-ndk-r22b-darwin-x86_64.zip
######################################################################## 100.0%
==> Installing Cask android-ndk
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --install
will prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Make sure the doctor is happy (do what it tells you):
brew doctor
Use Homebrew to install Android dev tools:
brew install ant
brew install maven
brew install gradle
brew install android-sdk
brew install android-ndk
Install all of the Android SDK components (you will be prompted to agree to license info and then this will take a while to run):
android update sdk --no-ui
ERROR::::::::::::::::::::
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
"android" SDK commands can be translated to sdkmanager commands on a best-effort basis.
Continue? (This prompt can be suppressed with the --use-sdk-wrapper command-line argument
or by setting the USE_SDK_WRAPPER environment variable) [y/N]: /Users/spiffy/Library/Android/sdk/tools/android: line 118: ${trysdkresponse,,}: bad substitution
Invalid or unsupported command "update sdk --no-ui"
Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk
~ ❯
Install HAXM for blazing fast emulators. Check out the “Configuring VM Acceleration on Mac” section here: http://developer.android.com/tools/devices/emulator.html
Update your environment variables:
export ANT_HOME=/usr/local/opt/ant
export MAVEN_HOME=/usr/local/opt/maven
export GRADLE_HOME=/usr/local/opt/gradle
export ANDROID_HOME=/usr/local/opt/android-sdk
export ANDROID_NDK_HOME=/usr/local/opt/android-ndk
Update your paths (bonus points to a better solution to the hardcoded build tools version):
export PATH=$ANT_HOME/bin:$PATH
export PATH=$MAVEN_HOME/bin:$PATH
export PATH=$GRADLE_HOME/bin:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/19.1.0:$PATH
Periodically run these commands again to ensure you’re staying up to date:
brew update
android update sdk --no-ui
- Note: It looks like there might be an issue with
brew update
and the android-sdk formula.
Install Eclipse, IntelliJ, Android Studio, or your other favorite IDE.
If everything goes smoothly on a moderate network connection you can expect this process to take 2-4 hours.