Repository navigation
Running on device should be possible #12
Description
Activity
You have a few options here, all of which are documented in AppDelegate.m:
- Run the server on your computer, change
localhostto<your computer's IP>, and do it that way. cURLthe 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.
- Run the server on your computer, change
@a2 is there any plan to streamline the process?
@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.
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").
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.
+1 for better way
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!)
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? :)@freshteapot - check this issue out: #240
- Not the best approach, Issue Documentation missing instructions for running on device via static bundle #240 is clearer, however either approach requires you to run this everytime you want to see your changes. A trade off :) *
To answer my own question:
"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.jsbundleNow at this point. You could do
curl http://localhost:8081/index.ios.bundle -o FULL_PATH/main.jsbundleAt this point, it works. At least on xcode 6.2.
- Not the best approach, Issue Documentation missing instructions for running on device via static bundle #240 is clearer, however either approach requires you to run this everytime you want to see your changes. A trade off :) *
@brentvatne thank you!
@freshteapot Thanks, It works~
Now possible
- added a commit that references this issue
on Sep 30, 2015 - added a commit that references this issue
on Jul 6, 2016 - added a commit that references this issue
on Mar 30, 2017 - locked as resolved and limited conversation to collaborators
on May 29, 2018 - addedResolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
on Jul 23, 2018
Currently throws up a red screen complaining that it can't find localhost