Skip to content

Instantly share code, notes, and snippets.

@jonshaffer
Last active February 17, 2016 05:59
Show Gist options
  • Save jonshaffer/5c682cb1caf917104b23 to your computer and use it in GitHub Desktop.
Save jonshaffer/5c682cb1caf917104b23 to your computer and use it in GitHub Desktop.

Android Studio's Android SDK Location

/Users/[Username]/Library/Android/sdk

Don't have a Homebrew managed NPM

Homebrew is a handy tool for installing applications on OS X that aren't available in the app store. The downside is having a package manager handle another package manager with different opinions on architecture gets hairy, and your NPM installation will have reliability issues in the future if you install Node with Homebrew. However if you're on Windows you shouldn't have an issue using Chocolatey.

The most robust way to install Node is by installing it under NVM (Node Version Manager). If you already have NVM, or have a version of Node 4+ installed from other means (not Homebrew), you can skip to Step 2.

Uninstall Previous Node Installation

You can uninstall an existing version of node by following the advice in this gist, supplied for brevity here:

rm -rf /usr/local/lib/node_modules
brew uninstall node

__fbBatchedBridge error on Android

Make sure React server is running

From this Stack Overflow answer: Make sure the React server is running by running:

react-native start

Fix debug server host & port in Android emulators

First, you'll want to note the computers' IPv4 address. One way to do this is by checking System Preferences -> Network or by executing the following line from the terminal:

ifconfig | grep "inet " | grep -v 127.0.0.1

Then I'll use this Stack Overflow answer to set the debug server host & port on our Android emulator.

From terminal, run:

adb shell input keyevent 82

Where you'll select Dev Settings -> Debugging -> Debug server host & port for device. It should look like 182.168.xxx.xxx:8081.

Missing Built-Tools when running Android

If you see an error something along the lines of "Failed to find build tools ..." you can use the following commands to install a specific version of build tools (taken from this Stack Overflow post):

android list sdk -a

This will show you a list of SDK tools to choose from the list. You can then use this command android update sdk -a -u -t # where # is the number associated with the SDK tool you want to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment