/Users/[Username]/Library/Android/sdk
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.
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
From this Stack Overflow answer: Make sure the React server is running by running:
react-native start
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
.
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.