Never used Xcode before? No worries. We’ll walk you through your first steps.
If you want to know more about Xcode, read more about the Integrated Development Environment "IDE" from Apple.
Creating an Xcode file from a Lightwell project.
Open up the project you’d like to publish. Navigate to the publish panel by clicking the publish icon in the top right of the window.
At this point you can edit the general app settings:
- Drag a 1024x1024 non-transparent PNG to the box at the top to update the app icon.
- Double click on the text underneath to edit the published name – also the display name when the app is installed.
- Double click on the version number to edit it.
In the first text field (Company/Individual Name), enter your name. Lightwell will automatically fill in the second text field (Bundle ID). A Bundle ID is simply a way for Apple to uniquely identify your app.
Finally, click on “Create Xcode project”. You'll be prompted to pick a spot to save the Xcode Project.
Opening up your new Xcode file.
Navigate to where you saved your Xcode Project. For us, it was our Desktop. You should see a folder titled named after your app.
Double click on MyLightwellProject.xcodeproj file. This will open up your project in Xcode.
Now that you have your project open in Xcode, the next step will be to get it ready to publish to the App Store. To do this, we need to tie your app to your individual Apple ID.
Let's start signing your app!
Linking your app to your Apple ID is an important part of publishing to theApp Store. It lets Apple know that the app that’s being published is being created by a real, verifiable company or person. This process is known as“Signing” and it’s a lot like writing your signature on an important document.
If you don't see the My Lightwell project at the top make sure the folder icon on the left is selected. In the middle of the screen you’ll see a section labeled “Signing”. If this is your first time opening Xcode it will say "No accounts found".
Click on the “Add Account” button. It will now ask you to sign in with your Apple ID.
Note: To test your app on a device you can use any Apple ID. (In the future to publish your app to the App Store, you'll need to enroll your Apple ID to the Apple Developer Program).
After successfully signing in, you can close the Accounts window. Now the Signing section will be updated.
Make sure that the "Automatically manage signing" checkbox is checked. Open the "Team" dropdown and select your name. It will display with "(Personal Team)" following it like it is shown below.
Linking your iOS Device to Xcode.
The next step is easy! First, plug in your iPhone or iPad into a lightning cable connected to your computer. Then, navigate to the top navigation bar in Xcode.
Next to the play and stop button, you'll see a "My Lightwell App" button next to a button with the name of an iOS device (like "iPhone 7 Plus”). Click on this and at the top of the following drop down, you should see the name of your own, personal iOS Device. In my case, it would be called “Mike Jaoudi’s iPhone”.
Next, hit the “Run” button.
If it is the first time you've plugged in this iOS device, Xcode will need to do a little work to set it up. The whole process can take up to 5 minutes so we recommend getting up for a nice stretch or some coffee. ☕
After Xcode has finished up, tap on the Run button again.
You should get an error like the one below. This is totally normal.
All this means is we need to do a little fiddling in the Settings app on our iOS device.
Giving your iOS Device permission to run apps from Xcode.
Like the title says, we need to let our iOS Device know that it’s okay to run apps from Xcode and our Apple ID.
Start by opening up the Settings app on your iOS Device. Find and tap on “General." Once in General, find and tap on “Device Management.”
Tap on your Apple ID email address. On the next screen, make sure you tap “Trust [your Apple ID Email Address]”.
Once you tap this you’ll see a pop up to confirm. Once again, hit “Trust”.
Running your app on your iOS Device through Xcode.
Last but not least, hop back over to Xcode and hit the Run Button again.
Your app should now run on your iOS Device. If you’re having trouble, read below where we’ve provided a couple Troubleshooting items.
Q: I clicked "My Lightwell Project" in Xcode but I don't see a Signing section.
A: Sometimes Xcode opens the information for the entire project instead of the individual project file. This is a pretty simple fix.
When clicking the dropdown, you'll see under the "Targets" section, "My Lightwell App". Click the app and you'll see the app settings.
If you've already selected the "My Lightwell App", make sure that the "General" tab is selected at the top.
Q: Xcode said my build failed. What should I do?
A: Email us at firstname.lastname@example.org! We'll be happy to help you out! : )