CLion/cmake for iOS/Android Audio App (not plugin)

Hi! I’m newish to JUCE, and wish I had know about it 9 years ago when I built and published an app in Xamarin Forms… The app worked great, though I had to do all the audio from the ground up, which made it really brittle, since I didn’t really know what I was doing - Stackoverflow came to the rescue way too many times! Anyway, after thinking long and hard about it, it seems like it might be time to bring that app back from the abyss of deprecated Xamarin projects that have been booted off the app stores and make it legit and scalable with JUCE! My question:

Folks say Projucer is out-of-date (mostly), though it sets up projects well - if I want to stick with Xcode, which I don’t :). I setup a few examle audio apps just fine, but I was limited to the Xcode IDE. I recently got into CLion and would realllly prefer coding with it, which (happily) pushed me into cmake land. So for a cross mobile device (iOS/Android) audio app, are there some go to templates or strategies to code in CLion, but still test in the iOS and Android mobile sims? I’d even be down with keeping Xcode and/or Android Studio open in the background just to run the sims, though doing everything through CLion would be a dream come true :). I found plenty of templates and videos out there on how to do this for plugins, but for this project, I need to go the Audio App (GUI + AudioComponent) route, and I can’t find much out there, and I wanted to ask the community. Cmake is new and somewhat intimidating time-investment-wise (coming from a hold-your-hand C# world).

Any and all advise is greatly appreciated! This seems like a fantastic community, and I’m really looking forward to pushing my audio software dev into the C++/JUCE realm :smiling_face_with_sunglasses:.

JUCE Android projects are currently only supported via the Projucer. You could use CMake for all the other platforms and only have a Projucer project in that one case if you prefer. That being said if you are only targeting iOS/Android maybe that would mean in some cases making changes to both projects[1].

In regards to running the iOS simulator I think you should be able to install and launch your app from the terminal (try running xcrun simctl for more info).

So I think you could probably avoid dealing with Xcode directly with CMake and some terminal commands.

Unfortunately I’m not sure if you could actually avoid using Android Studio though.

All that being said I don’t use CLion a lot myself and I haven’t tried the above so others may have some better suggestions.


[1] One way you could avoid some repetition between projects is to turn your source code into a JUCE module. This would mean new source files and some settings could be auto detected by both CMake and the Projucer.

2 Likes

Many thanks for the great response! This seems super viable. It looks like it wouldn’t be to much of a challenge to get debugging connected to the iOS sim being run through xcrun simctl. If that’s the case, I’d just need to actually spend some time figuring out CMake to tie things together. Your JUCE module link also gives me some confidence that cross-device won’t be too much of a hassle. The way the app was structured in Xamarin was there were “general” source files that were device agnostic, and then Xamarin.iOS and Xamarin.Android subprojects with source that took care of anything platform specific… in my case, audio engine code. But since JUCE would remove that hurdle, most of my code would be logic and GUI focused, so making a JUCE module to house it sounds like a good possibilty. Once the codebase is complete, I expect to need to open Xcode and Android Studio to go through the final publishing phase.

I’ve only dabbled with CLion for about a month (coming from VSCode/VS/Vim land), and it seems to be helping me wrap my head around some C++ specific concepts that are new to me. Maybe it’s just an excuse to learn something new! Maybe I should just take it easy and get a prototype working in Xcode :wink:

Many thanks again!