Skip to content

Running on device should be possible #12

@subtleGradient

Description

@subtleGradient
Contributor

Currently throws up a red screen complaining that it can't find localhost

Activity

a2

a2 commented on Jan 30, 2015

@a2
Contributor

You have a few options here, all of which are documented in AppDelegate.m:

  1. Run the server on your computer, change localhost to <your computer's IP>, and do it that way.
  2. cURL the file and change it so it references the saved file. You'll have to add the downloaded file to the app binary.

Hope that helps. If you have any trouble, just post here and hopefully we can get that sorted for you.

vjeux

vjeux commented on Jan 30, 2015

@vjeux
Contributor

@a2 is there any plan to streamline the process?

a2

a2 commented on Jan 31, 2015

@a2
Contributor

@vjeux Most definitely. We plan on putting in some sort of build step that "compiles" the JS source directly into a resource file in the app bundle. Obviously in production you wouldn't have a server running nearby.

mfikes

mfikes commented on Jan 31, 2015

@mfikes

For App Store submission, perhaps you have no choice but to include the JS in the bundle if you wish to comply with 2.7 ("Apps that download code in any way or form will be rejected").

sophiebits

sophiebits commented on Jan 31, 2015

@sophiebits
Contributor

Yes, we're not looking to download code over the internet for exactly the reason you mention. The Facebook Groups app in the store bundles all of the JS locally.

roman01la

roman01la commented on Mar 26, 2015

@roman01la

+1 for better way

iliekdags

iliekdags commented on Mar 26, 2015

@iliekdags

This should at least be documented on the website -- I'm sure it's going to confuse a lot of people initally until updated. (react native rules!)

freshteapot

freshteapot commented on Mar 27, 2015

@freshteapot

Under option 2).

Where exactly is the 'main.jsbunle' meant to be saved.
Have tried.

  • top level.
  • inside "AwesomeProject.xcodeproj"

"You'll have to add the downloaded file to the app binary":
Where is this? :)

brentvatne

brentvatne commented on Mar 27, 2015

@brentvatne
Collaborator

@freshteapot - check this issue out: #240

freshteapot

freshteapot commented on Mar 27, 2015

@freshteapot

"You'll have to add the downloaded file to the app binary":
Open Xcode -> Project (I will assume AwesomeProject)
Look in the folder Products, click "once" on 'AwesomeProject.app', look on the rightside and it should display "Full Path".

At this point, jump to the terminal, and navigate to the same directory.
Afterwards.

cd FULL_PATH
curl http://localhost:8081/index.ios.bundle -o main.jsbundle

Now at this point. You could do

curl http://localhost:8081/index.ios.bundle -o FULL_PATH/main.jsbundle

At this point, it works. At least on xcode 6.2.

freshteapot

freshteapot commented on Mar 27, 2015

@freshteapot

@brentvatne thank you!

gu-fan

gu-fan commented on Mar 27, 2015

@gu-fan

@freshteapot Thanks, It works~

vjeux

vjeux commented on Apr 1, 2015

@vjeux
Contributor

Now possible

14 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @subtleGradient@sophiebits@brentvatne@vjeux@a2

        Issue actions

          Running on device should be possible · Issue #12 · facebook/react-native