0

Is there a way to get the compile time (time at which i compiled the app, e.g. in utc or local). The reason I want this is that I often am not sure what version my emulator is running right now and adding a text widget at the top with the compile time would give me this security while developing.

SLuck
  • 521
  • 3
  • 14

1 Answers1

1

One way I would do that :

  1. make a shell script that runs before build, and gets current system time (for iOS, this can be done adding a script phase before your build phases, on android, you need to change your gradle, see : execute task before android gradle build?)
  2. Inject that time into a .env file, then use react-native-config to recover this 'buildTime' variable and display it.

There must be other ways to do that, but no ready-to-use tool to my knownledge, you will have to dive into Platforms specific build scripts ...

Vinzzz
  • 11,746
  • 5
  • 36
  • 42
  • thanks was hopeing to avoid this somehow^^ but thanks – SLuck May 28 '19 at 13:12
  • Personnally, I have no need for this. I just check that the build phase is successful (in XCode/Android Studio or Terminal), and app install was successfull, to know that my native code is up to date – Vinzzz May 28 '19 at 13:43