Skip to content

Instantly share code, notes, and snippets.

@cyberzilla
Created January 22, 2018 02:11
Show Gist options
  • Save cyberzilla/a2a2488102ba75b97b2c4296cd0d6e02 to your computer and use it in GitHub Desktop.
Save cyberzilla/a2a2488102ba75b97b2c4296cd0d6e02 to your computer and use it in GitHub Desktop.
React Native Doc
Documentation React Native:
1. Buat Project:
react-native init nama_app
2. Jalankan Emulator:
android avd
3. Masuk ke direktory project anda dan aktifkan webserver:
react-native start
4. Untuk menjalankan App
react-native run-android
5. Untuk Update Project, cukup update file App.js dan Reload App di Emulator dengan menekan Tombol "R" 2 kali
6. Untuk Build APK, masuk ke direktory project anda, dan jalankan perintah
cd android && ./gradlew assembleRelease
*Apk yang digenerate belum bisa di install di Device karena belum tersign
7. Untuk Mensigned APK
masuk ke directory project anda di your_project/android/app/build/outputs/apk/
akan ada file "app-release-unsigned.apk"
masih di directory yang sama buat keystore dengan mengetikkan
keytool -genkey -v -keystore [yourkey.keystore] -alias [youralias] -keyalg RSA -validity 10000
*[yourkey.keystore] dan [youralias] silahkan ganti sesuai dengan keinginan anda, tidak pake []
*Silahkan masukkan password dan informasi keystore yang diminta Misal:
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: Your Name
What is the name of your organizational unit?
[Unknown]: Your Organization Unit
What is the name of your organization?
[Unknown]: Your Organization
What is the name of your City or Locality?
[Unknown]: Your City
What is the name of your State or Province?
[Unknown]: Your State
What is the two-letter country code for this unit?
[Unknown]: 62
press: yes
*Kemudian Masukkan lagi Passwordnya
*Kemudian Signed Jarnya dengan mengetikkan:
jarsigner -verbose -keystore <path of my-keystore.keystore> <path of apk> alias_name
contoh dari kasus yang tadi:
jarsigner -verbose -keystore yourkey.keystore app-release-unsigned.apk youralias
Kemudian Zipalign dengan mengetikkan:
zipalign -f -v 4 app-release-unsigned.apk signed.apk
8. Done
*HAL PENTING
Jika ingin menjalankan project lain, silahkan close semua console terminal yang digunakan untuk run project, karena sering terjadi error "Not Registered"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment