Skip to main content

Mobile Development on a Chromebook with Crouton and Expo (React Native)

· 2 min read
Ziinc

To develop on crouton, you will need to allow ChromeOS to access to the required server ports locally, which is blocked by the chroot’s firewall. Effectively, you will be adjusting the firewall (using the iptables package) on the chroot’s startup. You will need to do this for the two ports required by Expo, 19000 and 19001. Follow the crouton documentation for more detailed instructions on running servers in crouton.

Add in the two lines as follows to /etc/rc.local

/sbin/iptables -I INPUT -p tcp --dport 19000 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 19001 -j ACCEPT

What this does is to expose the server ports on localhost only. If you were to try to connect through wlan (such as with your mobile phone), you would not be able to do so. However, since most chromebooks can run android apps now, you can install the Expo android app to connect directly to the Expo server.

If you need to pull up the Expo menu, you will need to physically pick up the chromebook and give it a shake (yes, you will look ridiculous doing this), as it is the only way to pull up the Expo menu. Expo should come up with a more intuitive way to do this, but until then, have fun shaking your chromebook!