Join Rafael Hernandez for an in-depth discussion in this video Deploying the app to a device, part of Up and Running with Titanium.
- View Offline
At some point in your development process, you'll want to test your app on a device. Android and iOS have different initial steps to prepare your device for development testing. Your Android device has to have USB debugging enabled, and because there are so many different implementations of Android, I can't necessarily show you the single way to do this. So instead, you should open up a search engine. And search Android, enable USB debugging. Additionally, you should probably put in what version of Android you're using because this is diffrent across Android versions.
When your device is enabled, you'll see a small bug icon in the status bar. Then, with your device connected to the computer, all you need to do is head to run, and click Android device. We won't do that now, because we don't have one connected to the computer. But it simply installs in the device, and you're ready to go. For iOS there are a few more steps. First you need to make sure that your device is certified and it's ready to go. So in Xcode with your device connected to the computer. You will look for your device. There is an icon next to your name and then there is at the right a circle and it should be green.
If it's green, then your device is ready to use. If not, then right click this area and choose Add Device to Member Center. Of course I'm assuming that you have a development certificate and you have taken care of that. Now, you'll need a provisioning profile. So to get one, under Provisioning Profiles, you would choose Add. I already have one, and it's valid, and I know that it's valid because it says, status, valid profile. With my device connected to the computer, I will deploy my app to it. So back in Titanium Studio, I'll click on the disclosure triangle next to run, and choose, iOS device.
Now, here, you're looking for these four check marks on the left. And, if you have them, then you're good to go. If you don't, well then, you might need a development certificate. Make sure the key chain is set to system defaults. Make sure that your provisioning profile is valid. And then, you'll build for whatever SDK you're using. Here, I'm using iOS 7. If you have an earlier SDK, you'll see it in this drop-down list. Finally, we'll leave this check box as is. If you happen to make any changes to your iOS developer account, let's say you add more provisioning profiles or you change your certificate, Choose Refresh.
And then, it will take a moment, but new values will appear. Now, I'll choose Finish. When the app is compiling and building for deployment, you may see some errors here in the console. If you do, you're best to look them up in the search engine to see what they are. And to see how others have gotten past them. Automatically, Titanium will tab to iTunes, and will show us the application. Now, in iTunes, I'm showing the sidebar. You can show that on your iTunes by going to View > Sidebar. I'll choose, Device here. And on the apps tab, it shows our app ready to be installed, so I'll choose Install, and then I'll choose Apply.
Once it's done syncing, I'll tab over to an application called Reflector, which is using air play, so that I can see my device. So, explore California appears, and I'll tap on it. And the application opens, and then I can use it. So I'll scroll the application, choose a row, and I see that it's good to go. Now a few other things, in ITunes if you don't have your icon files prepared then you won't actually see an icon file here. Instead you'll see a default appcelerator logo.
And also remember that under Library Apps you can choose to delete this from your iTunes. You don't have to delete it. If you are going to update it. You simply build it again in Titanium and it will update within iTunes. So we've covered the deployment of the App to the device for development purposes but when you are ready to deploy your app to Google Play or the Apple app store, you'll need to do something different. So in Titanium Studio, instead of choosing the disclosure triangle next to the run button, you'll choose this one over here next to the publish button.
Now I won't walk us through the entire procedure to distribute to either Google Play or the Apple App Store. Instead, know that when you choose one of these options, you have a file that's ready to go in order to go through the procedure to distribute to either of those places. If you want more information, then you can head to the title Android 4.1 SDK Jelly Bean New Features, in order to look at how you can distribute to Google Play. Or you can look at Distributing iOS Applications through the App Store to see how you can get your app on the App store.
- Setting up Titanium Studio
- Creating a new project
- Adding interactivity
- Using CommonJS modules
- Including platform-specific code
- Creating a preferences panel
- Making cross-platform adjustments