- Getting started with Fastdev
- Other Resources
- Common Issues or Problems
- Fastdev Commands
- Full Usage
The Fastdev server enables Titanium developers writing Android apps to rapidly test and see the changes they make in code. Instead of re-deploying the app after changes are made, the app requests whatever it needs under
Resources from the Fastdev server. In other words, when Fastdev is running and your app requests
app.js (or just about anything under
Resources), the latest version of
app.js on your dev machine gets served up to the app – there is no need for the full build-and-release process.
Currently Fastdev is only supported for the Android Emulator, but it will also be supported for devices in an upcoming release.
- MobileSDK 1.7.0 or above
- Follow the instructions in the Legacy Command-Line Interface guide so you can call the
Getting started with Fastdev
Demo Video / Blog
See the introductory blog and demo video here:
Titanium Mobile Intro Series: Fastdev for Android
Starting the Fastdev server
To put your app in Fastdev mode, you'll first need to run the Fastdev server, and re-deploy your app:
Start the Fastdev server for your app:
Run your app on the currently running emulator. This may require a full rebuild, since we build ALL modules into a Fastdev app to avoid missing functionality:
For convenience, you can avoid using the
--androidargument by setting the
- In Titanium, you can use the project's Run menu
At this point, you should be able to make changes to nearly anything under the
Resources directory, and they will be immediately available to your app. Keep in mind that changes aren't actually uploaded to the app, but rather the app will request the changes the next time they're needed. This means that in some cases, i.e. changes in app.js, you will need to restart the application to see the change. A restart here simply means restarting the app itself, not a full rebuild (like in previous versions of the MobileSDK).
Restarting a Fastdev app
Any one of these methods will cause the app to restart:
Re-run the application: You can just the same command as above:
- Manually restart by pressing the emulator's Back button, and clicking on it's icon in the App chooser.
However, keep in mind that you don't always need to restart your app for changes to take effect. For example, if you're using
Ti.UI.createWindow with the
url using Fastdev. Similarly, any time
Ti.include is called, Titanium will make a request using Fastdev. Generally, only changes in
app.js, and any scripts it might include with
Ti.include will require an application restart.
Fastdev is primarily concerned with the files under the app's
Resources directory, which means that any changes to the project outside of
Resources will require you to manually re-run the application as decribed above. Generally, this means these kinds of changes will require a full rebuild / redeploy:
- Changes to tiapp.xml
- Changes to JSS stylesheets
- Adding, Removing, or Updating a Titanium Module
- Adding, Removing, or Updating native Android Resources under
Fastdev also supports the platform-specific
Resources/android directory, which maps directly to
Resources, however any special android native images that are changed in
Resources/android/images/$CONFIG will require a full rebuild (where
$CONFIG is one of
high, or an Android resource identifier such as
Common Issues or Problems
Running the Fastdev server in the background
When starting Fastdev at the command-line, you may want to put it in the background so you can continue using that command-line instance.
Fastdev can be started in the background a number of ways:
Changing the Fastdev server's Idle Timeout
The Fastdev server shuts down automatically after being idle (i.e. no new requests by the app) for 30 minutes. You can increase this by passing a custom timeout when starting the Fastdev server:
Android emulator refuses to connect to Fastdev, even though it's running
The Android emulator will sometimes lose it's network configuration (essentially NAT), and fail to connect directly to the host machine. You may notice this when the Fastdev server is running, but the app constantly gives warnings that the connection has been refused or timed out. In this case, the best solution is to completely restart the emulator.
In all cases, the project is taken from the current working directory.
Starts the Fastdev server for a project. If the server is already running for this project, this has no effect.
Prints the status of the Fastdev server. Warns if the server is not running.
Stops the Fastdev server for a project. If the server is not running, a warning will be issued.
Restarts the app currently connected to the Fastdev server. If no app is currently connected, this has no effect.
Kills the app currently connected to the Fastdev server. If no app is currently connected, this has no effect.