-
Notifications
You must be signed in to change notification settings - Fork 23
Build on MacOS with XCode for iOS
-
Clone the SLProject GIT repository into a directory of your choice
-
For the setup with automatic app signing to enable app installation on your device:
- You need an iPhone or an iPad
- You need an apple id and a free apple developer account
- You have to install xcode
- You have to install cmake (I use dmg from the official website, uninstall all other versions before)
-
Add your apple id to xcode (https://learnappmaking.com/how-to-create-a-free-apple-developer-account/)
-
Start Xcode on your Mac
-
Choose the Xcode → Preferences menu and navigate to the Account pane
-
Click the +-button in the bottom-left corner and choose Apple ID
-
Log in with your Apple ID email address and password
-
Transfer your personal developer team id to cmake
-
Open the app "Keychain Access"
- On the top left of the window, select "login" under "Keychains" and underneath in "Category" select "Certificates"
- In the main window double click on your apple developer certificate (e.g. Apple Development: youremail@nothing.com (1234556))
- In the pop up window, copy (only) the id in the line containing "Organisational Unit". This is your personal developer team id.
- Transfer you developer team id to cmake (e.g. -DXCODE_DEVELOPMENTTEAM="<your_id>")
-
Open a terminal, navigate to this directory and run the following commands
- chmod +x generate_xcode_project_ios_personal.sh
- ./generate_xcode_project_ios_personal.sh
-
Open the xcode project file from directory BUILD_IOS
-
Build and install the app. You will get a prompt saying: Could not launch “"
-
On your device: go to Settings/General/Device Management and select "Apple Development: ".
- Select "Trust "Apple Development: ""
-
Back in xcode, build and install the app.
-
Open a terminal in the SLProject root folder and enter:
mkdir build_ios
cd build_ios
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_SYSTEM_PROCESSOR=arm -DCMAKE_OSX_DEPLOYMENT_TARGET=8.0