Skip to main content

Running NativePHP App: Build to Publish in App Stores

Premium
2 min read

From a code perspective, we have a fully functional application.

But now we have a question: How do we run it in a "Test" environment and launch it in an app store?


Running Local Variants

Running the application locally is as simple as running:

php artisan native:run

If you have it connected, you can play with your application in an emulator or on a real device.

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

technoquo avatar

Hi,

I'm currently testing a Mobile App connected to my Initial Web Application via API (http://talkapi.test/api). Everything works perfectly when testing in the browser.

However, when I run php artisan native:run locally and launch the Android emulator, I get the following error:

cURL error 6: Could not resolve host: talkapi.test

It seems the local API endpoint isn't accessible from the emulator environment using the local domain.

Do I need to host the API on a public server or use something like ngrok in order for the emulator to access it properly?

Thanks in advance for your help!

Modestas avatar

Hi, it seems that I missed the part in the course - will update!

But in general - yes, your API has to be publicly acessible. Ngrok works fine and that is what I was using.

Sorry about this missing detail!

technoquo avatar

Okay, no problem. Thank you very much for your response. I'm going to make the API public, and I'll wait for your update.

Modestas avatar

Updated the lessons to include notes about Ngrok :)

technoquo avatar

Thank you very much! I still can't find this note in the lesson?

Modestas avatar

It's a small one, just before the native:run command:

Note: If your API is running locally, remember to change the .env URL to Ngrok or a public one.
technoquo avatar

I saw it! Thank you for suggesting it.