See my blog for a project introduction as well as all related posts.
Licensed under CC-BY-NC-SA. Commercial licensing negotiable (hah).
- Getting started
- For Android development:
- Install Android Studio
- Windows-specific:
- Enable
Hyper-V
andWindows Hypervisor Platform
Windows features - Download Visual Studio 2019+ Community Edition and install the
Mobile development with .NET
workload andAndroid SDK setup
individual component. - Open Tools > Android > Android Device Manager to create and start a new device.
- Enable
- make sure
JAVA_HOME
is set in the environment, pointing at the root (notbin
) directory of a Java install. - make sure
ANDROID_SDK_ROOT
is set in the environment, pointing to (e.g.)../android-sdk
. - make sure
%ANDROID_SDK_ROOT%/platform-tools
is on the system path so thatadb
is available.
- For API and firmware development:
- Install dependencies
- Windows:
choco install awscli cmake mingw
and make sure the CMake directory (e.g.%ProgramFiles%\CMake\bin
is in the system path)- Particle CLI
- Mac:
- (TBD)
- Windows:
- Set the environment variable
GRUMPYCORP_ROOT
to point to the parent directory of this repo - In that directory:
git clone https://github.com/google/flatbuffers.git --branch v1.11.0
, creating a peer to this repo- Check the CI Dockerfile to make sure the version tag above is still correct
git clone https://github.com/particle-iot/device-os.git
for firmware headers
cd flatbuffers
and build:- Windows:
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
mingw32-make
- Windows:
- Configure credentials
aws configure
withAWS Access Key ID
=AKIA...
,AWW Secret Access Key
= password on file,Default region name
=us-west-2
- Set the environment variable
PARTICLE_ACCESS_TOKEN
to a Particle API token (generate withparticle token create
)
- Install dependencies
npm install
lerna bootstrap
lerna run decrypt-secrets
(make sureWAF_GIT_SECRETS_KEY
is present in the environment)- Can skip this step if not creating Android release bundles (i.e.
lerna run bundle:mobile
)
- Can skip this step if not creating Android release bundles (i.e.
lerna run build
- For Android development:
- Pre-commit
npm run format:fix
npm run lint:fix
- Deploy (dev API only, if needed - everything should run through CI)
npm run deploy:dev
All commands below start the web app locally, varying which API it calls:
Command | API | Cloud DB |
---|---|---|
npm run start:local:dev |
Local | Dev |
npm run start:local:prod |
Local | Prod |
npm run start:remote:dev |
Cloud (Dev) | Dev |
npm run start:remote:prod |
Cloud (Prod) | Prod |
All commands below start the mobile app server locally, varying which API it calls:
Command | API | Cloud DB |
---|---|---|
npm run start-mobile:local:dev |
Local | Dev |
npm run start-mobile:local:prod |
Local | Prod |
npm run start-mobile:remote:dev |
Cloud (Dev) | Dev |
npm run start-mobile:remote:prod |
Cloud (Prod) | Prod |
If the JS server fails to start (the window just closes), try running a full mobile build with lerna run bundle-mobile --stream
,
or cd packages/mobile
, npx react-native start
.
Note that for whatever colorful reason, switching between modes (e.g. ...local:dev
vs. ...remote:prod
) requires
a lerna run clean-mobile
in the middle.
lerna clean
to wipe allnode_modules
from packages (though not the root)lerna link convert
to move a new package's dev dependencies up to the rootpackage.json
npx sort-package-json
to clean uppackage.json
files- Updating packages (run in repo root):
npm update
lerna exec npm update --stream
lerna bootstrap
npm run build
to verify
npx jetify
inpackages/mobile-rn
to update Java code brought in undernode_modules
to AndroidX (required after any new native-containing npm module is installed)lerna run android:logcat
==adb -s (deviceName) logcat -s "ReactNativeJS"
for listening to ReactNativeconsole.log
outputadb devices -l
to find active device name
- Use Launcher Icon Generator to generate app icon sets
- For troubleshooting CircleCI YML indentation madness, get the CircleCI CLI and run
circleci config validate