# Workflow for iOS devices (pushing to device, debugging)

**URL:** https://discourse.cmake.org/t/workflow-for-ios-devices-pushing-to-device-debugging/7716
**Category:** Usage
**Tags:** os:ios
**Created:** [March 20, 2023, 2:29am UTC](https://discourse.cmake.org/t/workflow-for-ios-devices-pushing-to-device-debugging/7716 "2023-03-20T02:29:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RobN](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@RobN](https://discourse.cmake.org/u/RobN)
#### Post date: [March 20, 2023, 2:29am UTC](https://discourse.cmake.org/t/workflow-for-ios-devices-pushing-to-device-debugging/7716/1 "2023-03-20T02:29:23Z")

</div>

Does anyone use CMake to build and run an iOS app, without working (much) in Xcode? I’ve been using CMake + Emacs a lot lately, to build executables for desktop or command line. I’d like to start doing the same for iOS apps. When I used to use Xcode, it was pretty simple to compile and run a project on a simulator or device that was connected via USB cable. I’d like to setup a similar workflow with minimal use of Xcode. Is it possible?

Rob

---

<div class="post-metadata">

### Author: ![benthevining](https://discourse.cmake.org/user_avatar/discourse.cmake.org/benthevining/32/1924_2.png) [@benthevining](https://discourse.cmake.org/u/benthevining)
#### Post date: [March 20, 2023, 4:19pm UTC](https://discourse.cmake.org/t/workflow-for-ios-devices-pushing-to-device-debugging/7716/2 "2023-03-20T16:19:33Z")

</div>

I’m not sure if crosscompiling for iOS is supported with non-Xcode toolchains. You can use AppleClang + the Xcode CMake generator and still build only from the command line, though, without needing to actually use Xcode as your IDE.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 20, 2023, 4:39pm UTC](https://discourse.cmake.org/t/workflow-for-ios-devices-pushing-to-device-debugging/7716/3 "2023-03-20T16:39:23Z")

</div>

One can probably get CMake to _compile_ with a proper toolchain file, but all of the device simulator and other convenience things are Xcode behaviors that would need reproduced with `add_custom_command`.

---

<div class="post-metadata">

### Author: ![RobN](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@RobN](https://discourse.cmake.org/u/RobN)
#### Post date: [March 20, 2023, 6:59pm UTC](https://discourse.cmake.org/t/workflow-for-ios-devices-pushing-to-device-debugging/7716/4 "2023-03-20T18:59:29Z")

</div>

I can’t use the Xcode generator because it errors out when there C++ modules in the code. I’m using the latest Clang, not Apple’s Clang.

The brew package `ideviceinstaller` looks like it will be useful for pushing to a device, if I can compile something in the right format.

I did find `MACOSX_BUNDLE` for an executable, but so far I’ve got it creating an a macOS bundle, not an iOS one.

`add_executable(test_app MACOSX_BUNDLE test_app.cc)`

```sh
ideviceinstaller -i ./build-debug/Learning/test_app.app                     
Uploading test_app.app package contents... DONE.
ERROR: could not locate ./build-debug/Learning/test_app.app/Info.plist in app!

```

Because it’s put `Info.plist` it in a nested directory structure like a macOS app.
