Build iOS from source

Install Xcode

Before proceeding, you must first set up your local iOS development environment. This involves installing Xcode on a computer running macOS.

Download Xcode

Note: Please use the latest non-beta version of Xcode.

With your local development environment ready follow the below steps to download and build your Median app.

Download iOS Source

Download the iOS Source code from your app's private management page by opening the "Build & Download" tab and clicking the “Download Source” button under iOS as seen in Figure 1:

Figure 1

Figure 1

Extract the ios_source.tar.gz file and open

Extract the downloaded ios_source.tar.gz file and open your app using one of the following methods.

  1. Double click the ios_source.tar.gz file within the MacOS Finder application to extract the archive. Once extracted, open the new subdirectory and double click <yourapp>.xcworkspace.
  2. Open a terminal session and run the command tar -xzvf ios_source.tar.gz. Once extracted, enter the subdirectory and run open <yourapp>.xcworkspace.

🚧

Open .xcworkspace not .xcodeproj

Median uses Cocoapods (or "pods") as a dependency package manager, and therefore you must open the workspace file <yourapp>.xcworkspace and not the project file <yourapp>.xcodeproj.

📘

Using terminal command

The tar command in method #2 will extract the file to a subdirectory named “ios”. If there is an existing directory with the same name it will be overwritten.

Figure 2

Figure 2

Run App in Simulator

Select the simulator/device you would like to use to run your app and click the Run play icon as seen in Figure 3. Xcode will start building your app and when complete it will be launched in the selected simulator/device.

Figure 3

Figure 3

Adding Capabilities

Some plugins such as push notifications require manually adding Capabilities within Xcode. For example, to add the Push Notifications capability in your app first select your app from the left panel of Xcode. Then in the right panel select “Signing & Capabilities” and click “+ Capability” as seen in Figure 4:

Figure 4

Figure 4

Next, search and double click “Push Notifications” as seen in Figure 5:

Figure 5

Figure 5

Once Xcode adds a Capability, it will be visible at the bottom of the “Signing and Capabilities” section as seen in Figure 6:

Figure 6

Figure 6

Cocoapods

All "pods" required by Median should be automatically installed by our online build platform. If you need to install additional pods not supplied by Median please contact us for assistance and our team will assist.

📘

Missing Files

If you are receiving errors about missing files, you should clean your build folder/derived data: https://stackoverflow.com/questions/38016143/how-can-i-delete-derived-data-in-xcode-8