Viro: [Question] - Running app without ngrok tunnel

Created on 11 Oct 2017  路  6Comments  路  Source: viromedia/viro

Hi @achuvm,

Another question.

Is it possible to run the Viro library without ngrok at all?

Thanks,
Tom

Most helpful comment

Hi @dittmarconsulting,

Yes, it's possible to run Viro w/o ngrok.

If you're using the Viro Media App:
On iOS:

  1. If your phone and computer are on the same network, you can type in your local IP address.

On Android:

  1. You can also use your local IP address.
  2. You can reverse tether using the command adb reverse tcp:8081 tcp:8081 and simply use the localhost address: 127.0.0.1 in the Viro Media App.

If you're building your app through Xcode:

  1. in AppDelegate.m, change the line BOOL usingNgrok = YES; to BOOL usingNgrok = NO;, this will default to using local IP (this is automatically detected and "sent" to the built app).

If you're building your app through Android Studio:

  1. You should reverse tether using the command adb reverse tcp:8081 tcp:8081 and simply build and run the application.

Let me know if you need help or more clarification!

Andy

All 6 comments

Hi @dittmarconsulting,

Yes, it's possible to run Viro w/o ngrok.

If you're using the Viro Media App:
On iOS:

  1. If your phone and computer are on the same network, you can type in your local IP address.

On Android:

  1. You can also use your local IP address.
  2. You can reverse tether using the command adb reverse tcp:8081 tcp:8081 and simply use the localhost address: 127.0.0.1 in the Viro Media App.

If you're building your app through Xcode:

  1. in AppDelegate.m, change the line BOOL usingNgrok = YES; to BOOL usingNgrok = NO;, this will default to using local IP (this is automatically detected and "sent" to the built app).

If you're building your app through Android Studio:

  1. You should reverse tether using the command adb reverse tcp:8081 tcp:8081 and simply build and run the application.

Let me know if you need help or more clarification!

Andy

Thank you very much for the fast reply.

I was after the Xcode switch but I'm sure others will be interested in the other solutions as well.

It's especially important to turn off the tunnel to enable remote debugging unless that's possible with ngrok.

Thanks again,
Tom

I'm assuming that ngrok will not on release/production builds - how is that configuration handled? Is that in the docs somewhere?

Hi @mypark,

The use of a packager server vs bundled Javascript assets is a feature of React Native. We just added the ngrok bit to overcome a few issues, but the deployment/release process is the same as React Native.

Instructions for Android can be found here:
https://facebook.github.io/react-native/docs/signed-apk-android.html

iOS:
I can't find the instructions for iOS, but they're the same as any other iOS app out there, simply change the Scheme's Build Configuration to Release:
https://stackoverflow.com/questions/5706548/how-do-i-create-a-release-build-in-xcode

Let us know if you have any issues

Hi @achuvm,

Following up on this, if I want to locally distribute (ios) to coworkers without use of the apple appstore, am I unable to do so without an ngrok or local setup constantly running?

Update: forgot hello

Hey @Mrashes,

You should be able to perform a release build by clicking on the scheme -> Edit Schemes... -> Run -> Build Configuration -> Release. See the image below for reference.

Keep in mind you will need to do this for the React library as well as the ViroReact library before building your app too.

Let us know if you have any issues with that!

screen shot 2018-10-15 at 10 24 45 am

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Thomas101 picture Thomas101  路  3Comments

u-can-miracle picture u-can-miracle  路  3Comments

WillGeller picture WillGeller  路  3Comments

JStein92 picture JStein92  路  5Comments

vuthanhtrung0504 picture vuthanhtrung0504  路  5Comments