- Clone this repo to your machine
- Run
npm install
in the root directory - If you're using a physical device (instead of a simulator) make sure your android or iOS device is connected via USB and you've enabled Developer Mode on android, or clicked "trust this computer" on your iOS device
- Run
npm run android:device
ornpm run ios:device
to compile the app and load it onto your test device/simulator
If you haven't made any changes to the project's native dependencies since your last build then you can skip the build step (npm run [android/ios]:device
) and simply do these steps:
- Run
npm run start
to start the expo metro dev server - Press
a
to open on android ori
to open on iOS once the expo dev server has started. This will reopen the app that was built in the initial steps above. - If pressing
a
ori
doesn't work, open the app yourself on your device. It will show the expo dev client landing screen. Select "Enter URL manually" and enter the url and port shown by the metro server running on your computer, usually something likehttp://192.168.1.120:8081
. Press "Connect".
The easiest way to build the app for distribution is to use Expo's EAS service.
- Install the expo cli (docs)
- From the root of the project run:
eas build --profile development --platform android
# or
eas build --profile development --platform ios
- Install the app using the links provided in the terminal
Specific notes for iOS:
- In order to distribute the app on iOS you'll need to have an Apple developer account with an active subscription. Android does not have a similar limitation.
- In order to install the app on a new iOS device you'll have to generate a provisioning profile and have the user install it on their device (which registers their device UDID with expo), and then build a new version of the app. See the docs for more info.
See the expo development build docs for instructions.
Note: this requires the PyTorch Live app, which is slated to launch in July 2022
- Create a new branch with the date
YYYY-MM-DD-to-snack
- Delete the ios and android folders, which can cause the app to not work correctly when loaded as a snack:
rm -rf ios android
- Commit the changes and push the branch to github
- Go to https://snack.expo.dev/ and click the three dots next to "Project" in the left side panel. Select "Import git repository" and paste the link to directly your github branch (ex
https://github.com/jritch/outdoor-learning/tree/2022-06-30-to-snack
) - Share the new url that's generated (ex
https://snack.expo.dev/@git/github.com/jritch/outdoor-learning@2022-06-30-to-snack
)