title | description | keywords | author | ms.author | ms.date | ms.topic | ms.service | ms.assetid |
---|---|---|---|---|---|---|---|---|
iOS Getting Started |
Tutorial to onboard an iOS application in App Center |
app center |
lucen-ms |
lucen |
08/10/2021 |
article |
vs-appcenter |
f2af4edd-7d50-4e2d-8dd2-04eea4b755eb |
[!INCLUDE Retirement announcement for App Center]
In this tutorial, you'll learn how to set up a sample Swift app with App Center for iOS. Both Objective-C and Swift are supported.
-
Sign in to your GitHub account.
-
Access the sample app's GitHub repository.
-
Click Fork at the top-right hand corner of the page, and clone the repository.
-
Open a terminal and go to the sample app's directory.
-
Run the command below to install CocoaPods:
sudo gem install cocoapods
-
The included Podfile lists the dependencies in the source code. To install them, run the command below:
pod install
-
Open the
.xcworkspace
and press Run. The app should build without error.
-
Open the App Center portal.
-
Click Connect with GitHub and sign in, or use another provider.
-
Click Add new app.
-
Name the app Sample iOS App.
-
Choose iOS and Objective-C / Swift.
-
Click Add new app at the bottom.
In order for the sample app to send information to App Center, the app secret must be changed in Xcode.
-
Navigate to your app page in App Center by clicking it in the Apps list.
-
Go to the settings of your app by clicking Settings in the left sidebar.
-
Click the three dots in the upper right corner to open the context menu and then within it, click Copy app secret.
-
Open the
.xcworkspace
from the sample app folder. -
In AppDelegate.swift, edit the
didFinishLaunchingWithOptions
delegate method and paste your App Secret at the placeholder. -
Add, commit, and push changes to your forked repository. It can be done from the terminal, or a tool of your choice.
Code signing is optional, but recommended.
Code signing assures users that the app is from a trustworthy developer, and hasn't been altered by someone else. In App Center, it's needed to distribute the app to users. Learn more from the Apple Developer Documentation.
-
Open
.xcworkspace
from the sample app's folder. -
Go to General within the
.xcworkspace
file. -
Under Identity, edit the Bundle Identifier to match the app ID.
-
Import and select the provisioning profile under Signing (Debug) and Signing (Release).
-
Add, commit, and push changes to your forked repository. It can be done from the terminal, or a tool of your choice.
You're all set up to try out an App Center service. Not sure what to do next? Most people build their app next; check out the Build Tutorial for a short walkthrough.