Deploy locally
2 min
Follow the appropriate steps to deploy your Optimizely Configured Commerce Mobile SDK app locally for iOS and Android.
iOS
- Go inside the iOS folder (cd ios) in your project root and run the command pod update.
- Return to your project root folder cd .. when all the pods are updated.
- Run the following commands from the project root:
- flutter clean
- flutter pub get
- Ensure iOS simulator is running when all the dependencies are resolved. Running open -a Simulator.app helps you launch iOS simulator. Then, execute the command from the command line at the root of your project.
- flutter run
- Ensure you have installed the correct iOS provisioning profile that includes your device's UUID to run the app on an iOS device.
- Open ios/Runner.xcworkspace in Xcode.
- Project Navigator – Select Runner.
- Targets – Select Runner.
- Signing & Capabilities – Select the appropriate provisioning profile (development or adhoc).
- Execute flutter run to run the app on your device.
- Ensure you have installed the iOS App Store provisioning profile when you are ready to publish.
- Execute the command flutter build ipa to create the binary artifact for publication.
See Flutter's iOS documentation for information.
Android
- Connect your device or run an Android emulator.
📘 Note To resolve the Gradle dependencies required for Android, you should use Android Studio.
- Open the android folder in Android Studio to initiate the necessary Gradle sync.
- Run the following commands from the root of your project:
- flutter clean
- flutter pub get
- flutter run
- Ensure you have created a keystore for Android to sign the apk/aab when you are ready to publish.
- Run the command flutter build appbundle.
See Flutter's Android documentation for information.