0

I have a scenario where I've some info that needs to be stored in the keychain at the build time. Is there any way to achieve the same with the help of scheme -> pre-build -> run script? Is it feasible to achieve this? As I've only needed to store it while building. Can we use the swift/obj c file to write the code and call it at a pre-build time? Any way we can do the same with the help of a pre-build run script?

I am looking for a perfect way to achieve the same.

  • Which keychain are you referring to? – HangarRash Jan 23 '23 at 05:11
  • iPhone's keychain @HangarRash – Rinku Khatri Jan 23 '23 at 05:16
  • is it feasible? As I've some secrets which only needs to store at build time. – Rinku Khatri Jan 23 '23 at 05:17
  • 1
    Think about it. You are building an app on your Mac. Your iOS app's keychain is only available to your iOS app when your iOS app is actually running on a specific iOS device. How can your Mac populate the app's keychain when the iOS device isn't involved? It would help if you update your question with an explanation of why you need this and what problem you are trying to solve. – HangarRash Jan 23 '23 at 05:22
  • My scenario is I've stored my secrets outside the code in a txt file as a json, and at the build time, I want to load them in the keychain, to store and secure them. So I can avoid it to store it in my app as a plain text. – Rinku Khatri Jan 23 '23 at 05:26
  • Your point makes sense. So anyway I can do the same in any other way? – Rinku Khatri Jan 23 '23 at 05:29
  • See https://stackoverflow.com/questions/43111555/how-to-store-critically-sensitive-information-such-as-secret-key-token-encryp – HangarRash Jan 23 '23 at 05:43
  • Thanks for your valuable time @HangarRash it helps me a lot. – Rinku Khatri Jan 23 '23 at 06:03

0 Answers0