Comment on page
How to get your React Native app into Moropo
Moropo fully supports React Native.
In this guide, we will look at how to build React Native apps ready to import into Moropo and how to add identifiers to your app to improve test accuracy.
For each of the apps, we need to ensure that they are built in
releasemode. When a React Native app is built in
developmentmode it is dependent on the local JS server on your machine.
Remember that you need to make a new build every time that you make changes locally. If you are using Expo then you can make use of OTA updates instead to reduce the number of native builds that you need to create.
npx react-native build-android --interactiveand select
assemble, this will create both the
releaseapks in the android folder.
npx react-native build-android --interactive
Now take the output
app-release.apkand upload it to your app in Moropo.
cd iosto change your working directory to the ios folder and run
xcodebuild -workspace AwesomeProject.xcworkspace -configuration Release -scheme AwesomeProject -destination 'generic/platform=iOS Simulator'.
The important parts of that command are the
configurationset to release so that the app is not dependent on your local JS server and the
destinationset to Simulator so that a .app file is built ready for Moropo.
The file will be output to a special Xcode folder. For me that looked like this:
You will see this location output in the terminal at the end of the build.
Once you have located the file, compress it into a zip file and you're ready to upload to Moropo.
Compress the .app into a zip file
The first build has this full-width kitten addition and I would like to click on it in Moropo.
Unfortunately, there is no unique identifier against this component so the only thing Moropo sees when you click on the image is the percentage-based coordinates.
No cat id 😿
The way we solve this problem is by providing a unique reference in the code which allows it to be uniquely identified by Moropo.
Different frameworks have different ways of providing this identifier, on React Native the way to do it is with a
I have given the image a
And now we have a unique ID!
Cat id 😻