Skip to content

Latest commit

 

History

History
196 lines (124 loc) · 5.68 KB

File metadata and controls

196 lines (124 loc) · 5.68 KB

Installation - iOS

After setting up your environment, you can follow the steps below to run the pass Culture mobile application on iOS.

Further installation process

If you encounter errors during this setup, refer to the Troubleshooting section at the end of this document.

  • install iOS dependencies

    • Now you can install CocoaPods in the project pass-culture-app-native, that will install the gems, with:
    bundle install
    cd ios
    bundle exec pod install
    cd ..

    you may be asked to run:

    cd ios
    bundle exec pod repo update
    cd ..

If bundle exec pod install didn't work, check in Xcode -> Settings -> Locations if you have a Command line tools installed, then revalidate the Command line tools by clicking it.

🔥 Firebase setup

You will need to add the GoogleService-Info.plist file in the ios directory. You can get a copy of the testing configuration one through the password manager, or directly through the Firebase console inside Project Settings.

🔨Setup Xcode

In order to launch the app in the Simulator or on your external Apple device, you need to follow these steps:

  1. Create an Apple Developer passCulture account

  2. You need to install the version specified in XCODE_SUPPORTED_VERSION

  3. Install a simulator if not already in Xcode

  4. Download the iOS certificates to your computer:

    1. Connect to the Apple Developer account with Xcode.
    2. Get invited to the Apple Developer group by an Admin.
    3. Download the private key via fastlane:
    bundle exec fastlane ios download_certificates --env testing
    1. When required (multiple times), use the git ssh URL of the private certificates repository
    2. Get the match repo passphrase on Keeper in the "Tech" vault.
    3. It might ask your session password twice to continue.

🚀 Run the app with yarn

  • For Apple External Device

    Connect your device to the computer and run:

    yarn ios:testing --device

    or use the Xcode interface. Choose a scheme (like testing), then a device and click the Run button in the toolbar.

  • For Xcode Simulator

    Run:

    yarn ios:testing

    or use the Xcode interface.

    This will also start the metro server. If not, run in another tab:

    yarn start

😤 Troubleshooting

env: node: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code

If this error pops up while trying to build with Xcode it means that Xcode can’t find Node because the sym-link to Node is not made.

First option

Run ln -s "\$(which node)" /usr/local/bin/node

If it says “File exists”, rm /usr/local/bin/node and rerun the command above.

Drawback ❌: This sym-link will be obsolete as soon as the path of your node instance changes. To prevent this, you can command above to your .bashrc. Thus, the command will be run each time you open a new terminal

Second option

Add node with brew: brew install node

Drawback ❌: If you were using a node version manager (nvm, fnm, ...) you will now have two different node instances

❌ error: An organization slug is required (provide with --org)

This error means that the ~/.sentryclirc file has not been added correctly. Please run through this tutorial again

sentry reported an error: Invalid Token (http status: 401)

This error means that the sentry token you generated is invalid. Please run through this tutorial again and be careful with the scope permissions 😉

The application's Info.plist does not contain a valid CFBundleVersion

Make sure you installed jq so the CFBundleVersion can be automatically filled.

If it is installed but you still have the error, maybe Xcode doesn't find it: run which jq. If it does NOT print /usr/local/bin/jq, run ln -s (which jq) /usr/local/bin/jq to create a sym-link that Xcode will find.

No binary rubies available for: osx/13.5/arm64/ruby-3.0.0. Continuing with compilation.

https://stackoverflow.com/questions/42735805/what-does-no-binary-rubies-available-mean

After the `bundle exec fastlane ios download_certificates --env testing` command, you gave the SSH git repository link and it's not doing anything. It might be an issue with your ssh (for example if you only cloned the repository through http), try to clone the repository elsewhere using ssh and try again.
`/.rvm/gems/ruby-2.7.5/gems/nap-1.1.0/lib/rest/error.rb:76:in 'require': cannot load such file -- openssl (LoadError)` Try to change the openssl version you're on:
openssl version

if it's not 1.1:

brew install [email protected]
brew unlink openssl@3

check if the link worked:

Pod and cache

Pods may need to be installed again

$ (cd ios && bundle exec pod install)

Cache may need to be cleared and rebuilt

$ cd ios && rm -rf ./build && rm -rf ~/Library/Developer/Xcode/DerivedData/*