2 min read

Compiling the Audiobookbayshelf App on iOS

Compiling the Audiobookbayshelf iOS client can be challenging due to its numerous third-party dependencies. Although I don't have an active Apple Developer account, I still managed to make the following adjustments and successfully build and synchronize the client to iOS and iPadOS devices. Since access to their official TestFlight build is full, I look forward to the app soon being publicly available in the App Store.

1. Clone the Repository and Change Directories

git clone https://github.com/advplyr/audiobookshelf-app.git
cd audiobookshelf-app

2. Manage Node Environment

Clear any existing NPM cache that might cause issues.

npm cache clean --force

If you encounter issues due to an old Node version, you might need to remove it:

rm -rf /Users/your_username/.nvm/versions/node/v18.17.1/lib/node_modules/npm

Reinitialize Node Version Manager (NVM) to manage versions of Node.js.

export NVM_DIR="$HOME/.nvm"
. "$NVM_DIR/nvm.sh"  # This loads nvm
. "$NVM_DIR/bash_completion"  # Optional: loads nvm bash_completion

3. Update Shell Configuration

If you're using Zsh, update your .zshrc file to load changes:

source ~/.zshrc

4. Install Node.js

Install the latest Long-Term Support (LTS) version of Node.js:

nvm install --lts
nvm use --lts  # Ensure using the installed LTS version
nvm --version  # Confirm the NVM version

5. Set Up Ruby Environment

Install Ruby environment manager and Ruby build tools via Homebrew:

brew install rbenv ruby-build

Initialize rbenv and append its initialization command to .zshrc:

rbenv init
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc

Update Ruby versions to >2.7 and set it as the default:

rbenv install 3.3.0
rbenv global 3.3.0
rbenv rehash

6. Generate the Web App

npm run generate

7. Manage iOS Dependencies

Navigate to the iOS app directory to manage CocoaPods dependencies:

cd ios/App
sudo gem install cocoapods
pod install
cd ../..

8. Sync Web App with Native Platforms

Copy the web app changes to the native platforms (Android/iOS):

npx cap sync

9. Open the Project in Xcode

Open your iOS project in Xcode to proceed with native builds:

npx cap open ios

10. Update team and bundle identifier in Xcode

Under Signing & Capabilities for both debug and release:

  • Update the team to map to your apple developer account
  • Update the bundle to something unique since the default name associated with the project com.audiobookshelf.app is currently taken / reserved. I just appended my initials com.audiobookshelfdr.app