Skip to content

Instantly share code, notes, and snippets.

@bapjiws
bapjiws / remote-debugging.md
Last active August 12, 2018 18:22
Remote debugging for Android and iOS

Add alias ios-simulator="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/" to ~/.bash_profile (in my case ~/.zshrc). Restart the shell or run source ~/.zshrc.

Install iOS Simulator: Xcode > Preferences > Components

Gotcha: iOS Simulator refused to connect to localhost with VPN enabled.

See this article for more detail.

Remote debugging for Android devices via Chrome + chrome://inspect/#devices, also see port forwarding to access locahost from the Android device.

1. Asynchronous setState. Here's the problem:

// Various async stuff should reside here
componentDidMount() {
    this._getCity();
    this._fetchCitiesAsync();
    this._timer = setInterval(() => this._fetchCitiesAsync(), 5000);
}