Category Archives: Mac OS X

The right way to build Yandex Mobile Ads Example for iOS

To build the example with CocoaPods do the following steps:

Install build tools

Install Ruby with rbenv on macOS and install CocoaPods without sudo:

gem install cocoapods
(more…)

Installing Ruby with rbenv on macOS

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install rbenv

brew install rbenv
(more…)

Installing latest Ruby version on MacOS Sonoma with Homebrew

Determining how was Ruby Installed.

I have system Ruby:

% which -a ruby
/usr/bin/ruby
ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin23]

Installing Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(more…)

Application folder does not exist when MacOS app is run the first time

When my QT app starts first time on MacOS, its directory ./Application Support/Sharlines/Lines/ does not exit, but QT creates it when I write to QSettings first time.

To create the local directory I added the following code:

// Local data directory does not exist when the app is run first time on MacOS.
if (fs::create_directories(GetLocalFolder()))
{
    qDebug() << static_cast<QString>(qtil::Format() << "Local folder '" << GetLocalFolder() << "' has been created.");
}
(more…)

Launching the iOS Simulator from Terminal

Running a default Simulator:

open -a Simulator.app

List of devices:

xcrun simctl list
(more…)

Building Lines Game for MacOS and iOS

To build my app for iOS I tried to run CMake from the command line without QT Creator:

cmake -S /Users/admin/dev/repos/examples/src/LinesGame/LinesGameQt -B . -DCMAKE_GENERATOR:STRING=Xcode \
  -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=./.qtc/package-manager/auto-setup.cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/Users/admin/dev/libs/QT6/release/iOS/bin/qmake6 \
  -DCMAKE_PREFIX_PATH:PATH=/Users/admin/dev/libs/QT6/release/iOS \
  -DCMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang \
  -DCMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ \
  -DCMAKE_TOOLCHAIN_FILE:FILEPATH=/Users/admin/dev/libs/QT6/release/iOS/lib/cmake/Qt6/qt.toolchain.cmake \
  -DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DCMAKE_OSX_SYSROOT:STRING=iphoneos -DCMAKE_CXX_FLAGS_INIT:STRING= \
  -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM:STRING=XXXXXXX
(more…)

Publishing MacOS QT app in Apple App Store

First I set CMake generator to XCode in QT Creator Kits settings page:

(more…)

Publishing iOS QT app in Apple App Store

I downloaded provisioning profiles with XCode:

(more…)

Building QT6.7 on MacOS Sonoma

I installed MacOS Sonoma on HyperV, installed XCode and used the following commands to check compiler and SDK versions:

admin@son ~ % xcode-select -print-path
/Applications/Xcode.app/Contents/Developer
admin@son ~ %  xcrun -sdk macosx -find clang
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
admin@son ~ % clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
admin@son ~ % xcrun -sdk macosx --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk
(more…)

Installing MacOS Sonoma on HyperV

First I downloaded Sonoma on my Big Sur machine via Software Update:

and tried the following commands:

(more…)