Announcement

Collapse
No announcement yet.

Things you should know if you're just starting out in iOS

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Things you should know if you're just starting out in iOS

    We seem to be answering the same questions over and over, so let's start an informal FAQ. Feel free to add to the thread, or refine other people's tidbits. Here's mine:

    You can build and deploy iOS games with UE on Windows, but you'll have a far less stressful time if you use a Mac.
    It's not actually that much harder, but in the end Macs are much better and more reliable for debugging issues you might encounter with a live app. Everything about the Mac process is more streamlined. Also, you can only deploy code projects on a Mac, even if they have no code in them. Windows relies on everything being pre-compiled Mac binaries, including plugins.

    Remote build is difficult to configure and you don't have to.
    It's not a trivial process and I haven't personally figured it out, mostly because the setup is prone to failure. A better option is to sync your project between computers using Robocopy over SMB. There's a specific set of folders and files to ignore, but mostly make sure that you copy over your project file, source folder, build folder and config folder. Add everything else to the exclusions list. Use a program like Synergy to treat the Mac like a second screen. Here's the Robocopy script I use:

    Resync.bat:
    Code:
    cmd /k robocopy "D:\Dropbox\Active Projects\PoppyAndBuddy 4.22" "\\indium\justincook\UE4\Projects\PoppyAndBuddy" /e /zb /MT:3 /xo /xd .git /xd Intermediate /xd Saved /xd Binaries /xd .vs /xf .DS_Store /xd *.xcworkspace
    exit 0
    Note that you will want to copy your provisioning profile and certs to your Windows machine, install them there and select them in the project settings so that you don't have to re-select them every time you sync back to the Mac. And make sure you have another script for syncing back from the Mac to your Windows machine, just in case you do any changes there.

    Speaking of provisioning profiles, here's how you do it on a Mac
    The quickstart guide is great but there's a better way to do everything to do with provisioning and certs. First, use the developer site to set everything up. Don't use a wildcard BundleID, use a proper fixed one. Add all of your devices, set everything up there, then just leave them. Go back to XCode and go to Preferences -> Account and click "Download manual profiles". Reload UE. Select your provision and cert. Voila. Don't use Automatic Signing.

    And how you do it on Windows
    Same as above but instead of using XCode just install them to the computer by launching them. It's not that much harder. Most of the difficulty comes from the actual profile setup process, so try to go through every single link on the developer site sidebar.

    Make sure you know where they're actually kept.
    You'll want to delete them frequently during setup otherwise you'll never know which profile was the one you just created. On a Mac they live in /Users/You/Library/MobileDevice/Provisioning Profiles. On Windows they live in %appdata%\Local\Apple Computer\MobileDevice\Provisioning Profiles.

    And please, for your own sake, name them really well.

    How to get the same profile on Windows and Mac
    Follow the Mac process then go to where they're stored and copy the lot to Windows. Don't worry about the name, just launch everything in that folder on Windows. That covers the provisioning profiles. For the certificate go to XCode -> Accounts -> Manage Certs and export them with a password and copy it to Windows. Once again run it and let it install. (You might need to do this step in the Keychain app, I can't recall).

    Speaking of Keychain, load it up at least once a year and delete anything that's expired. Apple certs are set to expire annually and after that they're just clutter.

    DO NOT CHANGE THE SECURITY ON THE CERTS. Can't say this loud enough. If you change the password from "Ask every time" or whatever the default is to anything else it'll start failing to build in UE. Don't worry, it won't actually ask you every time, UE remembers your credentials for you.

    If you're forward of GMT you might need to mess with your system date
    There's a crazy Apple bug whereby if you're living in the future timezone-wise and you make a cert then it'll inexplicably fail to work for an entire day. That means that you need to set your Mac's date forward by a day in order to use your provisioning profile, but only on the day you created it. The next day you can set the date back to what it should be.

    Debugging on the device
    This is where the Mac really comes in handy. You can probably do this on Windows as well but it'll cost money and be a sucky experience. Mac: plug your device into the Mac, open XCode, go to Window -> Devices and Simulators and find your device. Click "Open Console". In the filter box at the top type the name of your project and hit enter. Bonus debugging tip: stick a phrase like "MyDebugOutput" in every string you print so that you can just filter by that. The iOS device console outputs a lot of garbage.

    Nothing I do is working
    It's not the program it's you. Seriously. Go back, start from scratch with new certs, a new project, etc. Just get a blank, empty project working on your device and then go back to your main project and try again.

    Testflight
    This is literally the best thing in the world, except when it's not. To deploy to Testflight you must make a "Shipping" build and "For Distribution". That means you can't use an ad-hoc provisioning profile like you do for development. Most of your build time will be spent switching provisions and certs because of this. Getting the "Entitlement GetTask not allowed" error during build means your provision doesn't match the kind of build you're doing (Shipping/Development). Once you have your app on Testflight, go nuts.

    Releasing
    UE leaves out icons all the time. It's not hard to fix, but if you don't fix it Apple will reject your app when they see one icon not being right. The fix for this has changed over time, but the one I use is to copy the IPA to Windows, unzip it, fix the neglected icon, re-zip it, re-sign the package using the Unreal iPhone Packager application and then copy it back to the Mac. The icons are stored in the /Build folder, so there's probably a way to fix it by putting the missing icon in there. You can figure out which icon it is by, again, unzipping the IPA.

    I don't know how you'd fix this if you only had a Mac as I've never worked out how to unzip an IPA on Mac. Tough luck I guess.

    Don't buy an old Mac
    Chances are that second-hand Mac Mini you're thinking about buying from EBay is being sold because it can't install the latest version of MacOS, which means it can't get the latest XCode, which Apple requires to release your app. Virtually all of the second-hand Macs I see on EBay are ex-development machines that no longer do the job.

    DO buy a decent iMac Pro. They're much faster than the Macbooks and you can get more memory in them. You want at least 16GB in case you need to do a custom engine build. Make sure you get at least six cores.

    Legend tells us that Hackintoshes also work, but that's even worse than getting Remote Build going. They are just a friggen nightmare, and you have the same problem as the second-hand Mac above: new OS means your Hackintosh breaks and you can no longer release updates. However, should you get a Hackintosh going it'll probably be faster than any Mac you can afford.

    One thing that I do continually hear as working really well is running MacOS in a VM. I'm yet to try this myself and I think you need a real Mac to even begin the process, but it's meant to be faster.

    That's it for me. Corrections and updates welcome.
    Last edited by Antidamage; 10-14-2019, 06:57 AM.

    #2
    iOS 13 is out and that means lots of you are seeing your XCodes update automatically and now you can't compile metal shaders anymore.

    Here's how you install an old version of XCode side-by-side and switch to it: https://medium.com/@hacknicity/worki...e-e331c01aa6bc

    Comment


      #3
      UE 4.24 doesn't just support XCode 11, it requires it. You'll need to go to Preferences -> Locations and select XCode 11 from the console dropdown. This is the reverse of what you had to do to get XCode 11 to work with UE 4.23.

      Comment


        #4
        Can you provide screen shots of "Preferences -> Locations" ?

        Comment


          #5
          Antidamage So first off I really appreciate this guide. This is the most straightforward guide of things to know when building for iOS that I've seen. I have a project that is complete but I have spent the last month or so running into code signing errors. I have started from scratch numerous times and even re-installed the engine but still am getting code signing errors along the lines of unable to build chain to self-signed root for signer or even that a development team isn't specified to go with the provisioning profile selected when I do a manual build even though it is clearly specified in Xcode project that goes along with the unreal project and its the correct one. I've tried packaging on windows and Mac. I need to configure a distribution build. Does it have to do with Apple Distribution cert vs iOS distribution cert? I've tried both several times but is there a right one to use? I just wanna package my game lol

          Comment


            #6
            You really want to build and sign on the Mac if it's time to release. Just remove any potential issues.

            You should try smacking "unreal engine" on the beginning of those errors and googling them. I found this: https://stackoverflow.com/questions/...-in-xcode?rq=1

            It looks like what I remember it being for me. Give that a go. Either way, when you're seriously unable to fix a signing problem and you know you've done everything right on the unreal end, then go back to your profile and certs and check everything there. Then wipe your system of certificates and profiles and re-acquire them via XCode.

            Comment

            Working...
            X