DEV Community

How to generate a debug apk in react-native

nitish on June 04, 2020

What is an .apk file? An Android Package Kit (APK) is the package file format used by the Android OS for distribution and installation o...
Collapse
 
impdp profile image
Pradeep Annadurai

And if you build frequently, you can make the shortcut for bundle command in the scripts of Package.json

"bundle-android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res"

and in the terminal use:
npm run bundle-android

Collapse
 
nickap profile image
nickap • Edited

This might be because the files monitored by the system have reached the limit!

You can increase the number of the files like this:

sudo gedit /etc/sysctl.conf
fs.inotify.max_user_watches=524288
You might want to check:
sudo sysctl -p

Collapse
 
gautham495 profile image
Gautham Vijayan

I did what the documentation said and got aab. With this post I got an apk thank you!!!

Collapse
 
edufrazao profile image
Eduardo Frazão

Hi. Its possible to link a local debugger to this "self-contained bundled" APK, in order to get errors or warnings, or even "console.log/warn" outputs?

I have a APP where part of the developers feeds the application with dynamic code (views and business rules with javascript), that are parsed at runtime.
This developers don't need the entire application project + development server in order to do their work. If they can only get this errors/warnings in some attached debugger, it will be nice!

Collapse
 
zanottaa profile image
Rodrigo

worked like a charm, thank you my friend.

Collapse
 
nitish173 profile image
nitish

Sorry for late reply, I hope you've been able to figure out the problem. Apparently, this error means there's no space on the drive. Check out this if it helps: stackoverflow.com/questions/224758...

Collapse
 
kaulsalil88 profile image
Salil Kaul

Just a heads in case you get an error that error ENOENT: no such file or directory, open 'android/app/src/main/assets/index.android.bundle'. Please create the same using mkdir -p android/app/src/main/assets . Source : stackoverflow.com/questions/494423...

Collapse
 
noursaloom profile image
Nour

thx a lot
but be careful guys
u should use npx before first command

Collapse
 
mustafasagdic profile image
Mustafa

Helps me a lot, thx!

Collapse
 
paulhoriachiy profile image
Paul Horiachiy

Thanks, it works!

Collapse
 
joweltisso profile image
Jowel Tisso

Great Thanks... Helped me alot..

Collapse
 
danebrown profile image
Dane Brown

Awesome stuff! Thank you very much

Collapse
 
harishkarthick profile image
Harishkarthick

Thanks bro..

Collapse
 
samihdev profile image
Samih

Thanks

for anyone facing file not found issue, refere to this:
stackoverflow.com/a/56520746/394674

Collapse
 
mostafij profile image
Mostafijur Rahman

That's worked like a charm..thanks bro

Collapse
 
qazafisheikh profile image
Muhammad Qazafi • Edited

I am creating debug with following above setups but when it install it shows blank white screen , I following steps for almost 8 month but now i am getting this error in app-debug.apk

Collapse
 
satyamgitt profile image
Satyam rao

but if the app not getting loging after apk made what should do