Ten Easy Steps to running on iPhone
I know it’s 2024, but I just got a debug build of an iPhone app onto an iPhone. I thought I’d document the process explicitly because, although this process has been around forever, there is a lot of incomplete and confusing information on the web about how to actually get an app on a phone. So now that I’m blessed with the hindsight of seeing “Hello world” on my own little glowing rectangle, I thought I’d share how I did it. This is the blog post I wish I’d found before I started worrying about how to do it.
I’ll invert my process for you! Steps first and worries second:
- Create a new Apple ID. I did this by creating a new local user account on my macbook, signing in to that account, and then going to settings. During this process, Apple offers to create a free iCloud.com email. I had already made a new email for this process, but in retrospect the free iCloud one probably would have been fine.
- When creating this account, you’ll be asked for a phone number. Just use your own phone number.1
- Go to developer.apple.com and accept the developer agreement. You’ll have to get a 2FA code from the Macbook.2
- Launch XCode, open the app you’re working on, and sign in with the new Apple
ID. For some reason this step texted me a 2FA code while all the other steps
wanted a 2FA code from the other local account.
¯\_(ツ)_/¯
- Put the iPhone in Developer Mode, under Settings > Privacy & Security. You have to accept the scary warning and reboot.
- Connect the iPhone to the laptop with whatever proprietary cable is appropriate to your particular hardware.
- In XCode, you should see your phone in the list of build/run targets. Select it and press run.
- You’ll see an error that you need to trust the developer. On the phone, go to Settings > General > VPN & Device Management3, tap your own developer account, and trust the app.
- Go back to XCode and try to run the app again!
- Profit!4
So now that I’ve done that, I’d like to talk a little bit through why I found this process particularly stressful and annoying, and it took me a minute to actually do it5. The core requirement I remember reading is basically: “An iPhone will only run an application bundle signed by an Apple ID that has 2FA on and is associated with an Apple Developer account.” This phrase, or whatever version of it I actually found, threw me off for a little while. Apple Developer Accounts cost $100 / year, and the sign up page has some very intimidating language about identifying the legal entity that will own the app.
There were a few things I was afraid of:
- Losing pictures of my kids because someone decided to DMCA takedown a hobby app or something. I don’t know how realistic this worry was, but that’s why I made a whole new email address and Apple ID. (It’s also just good practice not to have the “contact the developer” email go to my personal email.)
- Running into some weird progress blocker like needing a phone number for the new Apple ID, because my research indicated I would need one.
- Having to create a legal business entity to own the apps before I could proceed at all.
I think the “Separate developer ID, but still an individual account” is enough for me, for a few reasons. First, according to the official FAQ, you can switch the developer account from personal to organization later, so if I decide I need an LLC for other reasons, I can change it. And it turns out, with regards to needing a dedicated phone or number for the new Apple ID, I just made up this requirement. (I did need a macbook, but I’m running XCode anyway, so it’s not a new requirement.)
Anyway, so now that I can put debug builds of an app on an iPhone, maybe you all will get some posts about iOS development, or even a launch announcement.
Till next time, happy learning!
– Will
-
For a while, I was worried that this would make me need a new phone number, and I even found a “helpful” apple community post. But no, Apple ID’s have 2 phone number fields: one that can identify the account (in case it was created from a phone number and not an email) and N that are trusted for 2FA. So you can just put in your own phone number in 2FA. ↩︎
-
I wanted to use my own (personal Apple ID) macbook account, so I ended up doing a lot of this from one user account and getting 2FA codes from the other local user account. This was annoying but it worked. ↩︎
-
For a while, I was wondering why this was in “VPN & Device Management”. I think it’s because the overwhelming use case for this setting is trusting a corporate app that’s not available in the wider app store, and this is next to the setting where you accept the corporate VPN. I guess. ↩︎
-
Or debug forever. ↩︎
-
And by a minute I mean six months at least ↩︎
Note: recently submitted comments may not be visible yet; the approval process is manual. Please be patient, and check back soon!
Comments