Publish your App/Game on the Apple App Store without Macbook

Hamid Ayub
4 min readMay 17, 2024

--

Publishing an app or game on the Apple App Store typically requires a Mac. However, you can leverage various tools and platforms to develop, build, and submit your app without owning a MacBook. This tutorial will guide you through using a combination of an Apple Developer account, Unity or cross-platform tools (React Native, Flutter) for application development, CI/CD services, and using Fastlane to automate the final submission.

Pre-requisites

  1. Apple Developer Account: Register for the Apple Developer Program.
  2. GitHub Account: Host your code repository.
  3. Cross Plateform Setup: develop your project in unity, react or flutter
  4. CI/CD Service: Choose a CI/CD service like Bitrise, GitHub Actions, CircleCI, or App Center.
  5. Fastlane: Install and configure Fastlane for automation.

Step-by-Step Guide

Common part: Create, develop, and build your project as usual

  1. Develop Your App

Unity:
- Set Up Project: Create your project in Unity and configure it for iOS.
— Go to `File` > `Build Settings`.
— Select `iOS` and click `Switch Platform`.
- Develop and Test: Develop your app or game, ensuring it meets Apple’s guidelines.

Pro Tip: Use Unity’s Asset Store to find plugins that can accelerate development, such as ProBuilder for 3D modeling, or DOTween for advanced animations.

React Native:
-Set Up Project:

 npx react-native init YourAppName
cd YourAppName

- Develop and Test: Build your app using React Native components and APIs.

Tip: Use Expo for easier setup and testing, especially if you’re new to React Native. It simplifies the development process with managed workflows.

Flutter:
-Set Up Project:

 flutter create your_app_name
cd your_app_name

- Develop and Test: Build your app using Flutter widgets and plugins.

Tip: Use popular plugins like `provider` for state management and `dio` for network requests to enhance your app’s functionality.

2. Host Your Code on GitHub

- Create a repository on GitHub and push your project code to it.

Pro Tip: Use GitHub Actions for automated testing and continuous integration to ensure your code remains stable and bug-free.

Important Part: Now you will learn the CI/CD necessary work for ios build and delivery to app store as beta or release — Sit Tight

3. Set Up CI/CD Pipeline

Choose a CI/CD service that supports macOS environments. Here, we’ll use GitHub Actions as an example.

GitHub Actions Workflow for iOS:

name: Build and Deploy iOS App
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Install Fastlane
run: gem install fastlane -NV
- name: Install dependencies
run: bundle install
- name: Build and Deploy
run: bundle exec fastlane release
env:
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}

Environment Variables:
Store your sensitive data, like the App Store Connect API Key, Issuer ID, and Key ID, in GitHub Secrets or your CI/CD service’s secret management tool.

4. Configure Fastlane

Install Fastlane:
- Fastlane is used to automate the build and release process. Install it on your CI/CD environment.

gem install fastlane -NV

Initialize Fastlane:
- In your project directory, initialize Fastlane.

fastlane init

Create App Store Connect API Key:
1. Go to App Store Connect.
2. Navigate to Users and Access > Keys.
3. Generate a new API key and download the `AuthKey_XXXXXXXX.p8` file.
4. Note the `Key ID`, `Issuer ID`, and the `API Key` file.

Configure Fastlane:
- In your `Fastlane` folder, configure the `Appfile` and `Fastfile`.

Appfile:

# fastlane/Appfile
json_key_file("path/to/AuthKey_XXXXXXXX.p8")
issuer_id("YOUR_ISSUER_ID")
key_id("YOUR_KEY_ID")
app_identifier("com.example.yourapp")
apple_id("your-apple-id@example.com")
team_id("YOUR_TEAM_ID")

Fastfile:
Add a lane to build and upload the app.


# fastlane/Fastfile
default_platform(:ios)
platform :ios do
desc "Build and upload a new version to the App Store"
lane :release do
build_app(scheme: "YourAppScheme")
upload_to_app_store(
app_identifier: "com.example.yourapp",
api_key_path: "path/to/AuthKey_XXXXXXXX.p8",
api_key_id: "YOUR_KEY_ID",
api_issuer: "YOUR_ISSUER_ID"
)
end
end

5. Export the Build

- Your CI/CD pipeline will export the .ipa file, which you can download for final submission.

Tip: Set up notifications (e.g., Slack, email) to alert you when a build is complete or if there are any issues.

6. Automate Final Submission with Fastlane

By configuring Fastlane to handle the final submission, you can bypass the need for a physical or cloud-based macOS environment for the submission process.

Automate Version Bumping: Automate version and build number bumping to avoid conflicts.


increment_version_number(
bump_type: “patch” # Options: “patch”, “minor”, “major”
)
increment_build_number

TestFlight Integration: Use Fastlane to automatically upload your app to TestFlight for beta testing before submitting to the App Store.


lane :beta do
build_app(scheme: “YourAppScheme”)
upload_to_testflight
end
fastlane ios beta

Error Handling and Notifications: Add error handling and notifications (e.g., Slack) to alert you of build or upload failures.


lane :release do
begin
build_app(scheme: “YourAppScheme”)
upload_to_app_store
slack(message: “Successfully deployed new version!”)
rescue => exception
slack(message: “Failed to deploy new version: #{exception.message}”)
raise exception
end
end
fastlane ios release

Additional Tips and Best Practices

- Automate Testing: Use unit tests, integration tests, and UI tests to ensure your app functions correctly before submission.
- Monitor Builds: Integrate monitoring tools to track the status of your builds and quickly identify any issues.
- Optimize Performance: Use profiling tools to optimize your app’s performance, reducing load times and improving user experience.
- Review Guidelines: Regularly review Apple’s App Store Review Guidelines to ensure your app complies with all requirements.

Conclusion

By using a combination of cross-platform development tools, CI/CD services, and Fastlane, you can publish your app on the Apple App Store without owning a MacBook. This approach leverages modern development and deployment practices, allowing you to focus on building great apps while minimizing hardware dependencies. Integrating Fastlane with your CI/CD pipeline can further streamline the process, making automated submissions and testing more efficient.

You can check Gist Link.

--

--

Hamid Ayub
Hamid Ayub

No responses yet