Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Basic instructions to build the PlayTorch app #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,79 @@

This folder contains the code to build the PlayTorch app.

## Development

Build the PlayTorch requires the React Native development environment to be set up. If you haven't done this before, follow the steps on the [React Native Environment Setup](https://reactnative.dev/docs/environment-setup) steps on the React Native website.

### Navigate to PlayTorch app directory

Navigate to the PlayTorch app directory.

```
cd app
```

Note: It's the same directory as this `README.md`. You can skip this step if you are already in this directory.

### Install app dependencies

The PlayTorch app is a Expo prebuild app. It uses `yarn` to manage app dependencies. Use the following command to install all dependencies:

```
yarn
```

### Run app on Android

#### Change gradle.properties

Update the Gradle `distributionUrl` from

```
distributionUrl=../../../../../ci/gradle-7.5.1-all.zip
```

to

```
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
```

Or alternatively, apply the following patch:

```diff
diff --git a/app/android/gradle/wrapper/gradle-wrapper.properties b/app/android/gradle/wrapper/gradle-wrapper.properties
--- a/app/android/gradle/wrapper/gradle-wrapper.properties
+++ b/app/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=../../../../../ci/gradle-7.5.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
```

Build the app for Android

```
yarn android
```

### Run app on iOS

Install CocoaPod dependencies

```
(cd ios && pod install)
```

Build the app for iOS

```
yarn ios
```

## Attribution

The following pages contain the attribution notices for third party software that may be contained in portions of this product:
Expand Down