Crowdsourcing the retrieval of stolen bikes.
Development of the PedalPatrol iOS and Android application.
- Clone the github repository.
git clone https://github.com/PedalPatrol/PedalPatrol.git
- Move into the Pedal Patrol directory with the package.json file.
cd PedalPatrol/PedalPatrol
- Install the dependencies.
npm install
- Run the setup script to setup any dependencies properly.
npm run setup
- Add your Google Maps API key to PedalPatrol/android/app/src/main/AndroidManifest.xml to the meta-data for key "com.google.android.geo.API_KEY"
...
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="--YOUR-API-KEY--"/>
</application>
- Obtain the config details for your Firebase project from https://console.firebase.google.com and include them in the databaseConfig object in PedalPatrol/src/config/config.json
- In the iOS app on Firebase, download the GoogleServices-Info.plist and store it in PedalPatrol/ios. Add the file to the ios project if it is not already included by right clicking on the project name and clicking "Add Files to PedalPatrol".
- To setup for iOS run the following command:
npm run setup:ios
- Start an emulator either from the command line or from Android Studio. MacOS
~/Library/Android/sdk/emulator/emulator -avd EMULATOR_NAME
Windows
C:/Documents/user/Library/Android/sdk/emulator/emulator -avd EMULATOR_NAME
- Building and Running - For more information on debugging see: https://facebook.github.io/react-native/docs/debugging 2.1 Debugging and output on command line - The app can be debugged from the command line by running the following command:
react-native log-android
2.2 Debugging and output in browser - The app can be debugged from Google Chrome or another browser by running the following command:
react-native run-android
- Follow the steps here to setup running on a physical device.
- Run any of the above commands to run on android.
- Building and Running - Run the following command to debug on an emulator:
react-native run-ios
Note 1: Only MacOS computers with Xcodebuild tools and Xcode can build and run the iOS app. Note 2: react-native log-ios does not currently work on the version of react-native that is used in PedalPatrol. Note 3: The default ios emulator device is an iPhone X. The emulator used can be changed using the following command (example using iPhone 8):
react-native run-ios --simulator="iPhone 8"
- Follow the steps here to setup running on a physical device.
- Run the following command:
react-native run-ios --device
or
react-native run-ios --device "NAME_OF_CONNECTED_DEVICE"
Tests are facilitated by the Jest tool and can be found in PedalPatrol/test. The folder structure of the tests is the same as in PedalPatorl/src. Tests are automatically run with the --silent flag on. To run the tests run the following command from PedalPatrol/PedalPatrol:
npm test