Code Monkey home page Code Monkey logo

audius-mobile-client's Introduction

Audius Mobile Client

The Audius React Native mobile client. It can be run against a local client or against a production build.

Setup

Copy the environment variables and replace missing values (you will need an FCM sender id as well as a Segment write key)

cp .env.dev.tmpl .env.dev
cp .env.stage.tmpl .env.stage
cp .env.prod.tmpl .env.prod

Running against localhost

To run against localhost, specify URL_OVERRIDE in .env.dev:

URL_OVERRIDE=http://localhost:3001

The WebView will be pointed at the url contained in URL_OVERRIDE

Running against a local static build

To run against a local staging or production build, build the client and copy the build into the mobile client:

# staging

# audius-client
npm run build:mobile-stage

# audius-mobile-client
npm run copy:local-staging

# production

# audius-client
npm run build:mobile-prod

# audius-mobile-client
npm run copy:local-production

Running against a remote static build

To run against a remote staging or production build, pull a the latest dapp from s3:

Make sure you have s3 creds set up and the aws cli installed.

# staging
npm run copy:remote-staging

# production
npm run copy:remote-production

iOS

# install cocoapods
sudo gem install cocoapods
# install local dependencies
npm install

cd ios
pod install
cd ..

# Run a simulator pointed at a static build
npm run ios
# Run a simulator pointed at localhost
npm run ios:dev
# Run the app on a device
npm run ios:device "Raymond's iPhone"
# To see available devices
xcrun xctrace list devices

Android

# Run a simulator pointed at a static build
npm run android
# Run a simulator pointed at localhost
npm run android:dev

# Look at android devices
adb devices
# Connect device to dev server
adb -s <device name> reverse tcp:8081 tcp:8081
# If connecting to localhost, set up port forwarding
adb -s <device name> reverse tcp:3001 tcp:3001
# Run on device
npm run android

If you run into issues, try cleaning the android build folder

cd android && ./gradlew clean && cd ..

Debugging

  • To debug the native-layer of the app, install React Native Debugger and enable debugging (Cmd + D) in the simulator.
  • Safari can also be used to debug against the WebView running the dapp. This can be seen by opening Safari > Develop > Device > Localhost.

On Android, you can use the adb Android Studio tool or

# Show device logs
adb logcat '*:V'

Helpful

  • Sometimes the simulator app code won't update. You should disable caching in settings/Network of React Native Debugger.
  • If you feel like debugging the actual static app contained in the build, you can:
npm install -g serve --user
serve -s web-app/Web.bundle/build -p 9000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.