Skip to content

Instantly share code, notes, and snippets.

@SalahAdDin
Last active May 29, 2022 06:11
Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save SalahAdDin/284f42f82de735bf9a2efe8c094e2e64 to your computer and use it in GitHub Desktop.
Save SalahAdDin/284f42f82de735bf9a2efe8c094e2e64 to your computer and use it in GitHub Desktop.
Instlling React-Native Android Environment in ArchLinux

First step: Install Android SDK

  1. yaourt -S android-sdk android-sdk-platform-tools android-sdk-build-tools
    Note: Maybe you'll have problems with the lasta package: ncurses5-compat-libs. In order to avoid this problem you have to use this command: gpg --recv-keys F7E48EDB. You can find clarification here.
  2. yaourt -S genymotion
    Note: You'll need install virtual-box and his modules, yaourt will make for you but you need choos between ArchLinux host modules or DKMS host modules.
  3. Enter in super user mode with su - and then do echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf
    Note: You need do this with super user because need super user permissions and with sudo, for us at least, doesn't work.
  4. sudo modprobe vboxdrv vboxnetadp vboxnetflt
    Activate for current session.
  5. sudo chmod -R 777 /opt/android-sdk
    Give permisions over Android SDK folders.
  6. Restart
    Is needed by Genymotion for detect VirtualBox modules.
    NOTE: You need install Java JDK for user Android SDK.
  7. /opt/android-sdk/tools/android This command launch Android SDK. You can make fixed in your dock application (for example Plank), or create a desktop-launcher.

Second step: React-Native

  1. npm install -g react-native-cli Note: You need have installed node and npm for use React Native.

Optional Step: Upgrade watchers limit

  1. echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf Note: Use this command in super user session.
  2. sudo sysctl -p /etc/sysctl.conf Make this active without reboot session.
@rs4231199
Copy link

it is up to date?

@SalahAdDin
Copy link
Author

I'm not sure, I don't use it since a long time ago, but if you test it and find any problem, just write or update the gist.
Thanks.

@rs4231199
Copy link

It worked with few modifications in First step(Install android sdk).
By default jdk13 is installed but we need jdk8. I don't know the reason but it was giving some error when jdk13 was used.
i) install jdk8. sudo pacman -S jdk8-openjdk
ii) use jdk8 as defalut. sudo archlinux-java set java-8-openjdk
iii) now accept sdkmanager licenses. /opt/android-sdk/tools/bin/sdkmanager --licenses

@malta895
Copy link

malta895 commented Oct 3, 2020

To upgrade watchers limits without being in a superuser session you can use tee:
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf

@bug-author
Copy link

First Step
3. To enter into superuser mode, you have to first su - in the terminal and then echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf

@SalahAdDin
Copy link
Author

First Step
3. To enter into superuser mode, you have to first su - in the terminal and then echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf

Thanks!

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