CADT is an app for your mobile development device that makes it quick and easy to see your code in action. It provides the Cordova framework of Chrome Apps for Mobile so you can test your code by simply pushing your Chrome App assets to your mobile device (made easy with our tools), which is much faster than packaging up the entire mobile app. This is called live deploy.
With CADT running on your mobile device, live deploy can be initiated from your development computer with either Chrome Dev Editor or the cca
command line tool, allowing you to instantly preview the Chrome App you're editing, running right on Android or iOS. When you make a change to the code in your editor, you're a quick push away from seeing it straight on your device.
cca
provides all the functionality you need to develop and package Chrome Apps for Mobile from the command line. Use it with CADT to rapidly iterate on your code: live deploy allows you to instantly see your Chrome App running on a connected mobile device. When you are ready to publish your Chrome App for Mobile to the Apple App Store and Google Play Store, use cca
to bundle up your Chrome App into the proper mobile packages.
CDE is an IDE built specifically for Chrome Apps. Use it with CADT for live deploy.
There are three different workflows that you can use to run your application:
- Option A: Live deploy with CADT (quick and easy, but not everything works!)
- Option B: Use
cca
to package your application and deploy it to your mobile device - Option C: Use a third party IDE, such as Eclipse or Xcode. The use of a third party IDE is entirely optional (but often useful) to assist with launching, configuring, and debugging your hybrid mobile application.
- Follow these instructions to install CADT on your mobile device.
Note: Remove all older versions of CADT from your mobile device so that only the latest version remains.
-
Use either
cca
or CDE as your tool to initiate live deploy from your development computer. -
Enjoy live deploy! First, run CADT on your mobile device. Then:
####cca
Navigate to your Chrome App's directory. Then deploy:
- IP deploy:
cca push --target=IP_ADDRESS
- USB deploy:
- Android: As of
cca@0.6.0
, no manual port forwarding is required! - iOS: To setup, obtain tcprelay.py and use
adb tcprelay.py 2424:2424
- Use
cca push
- Android: As of
- New! » Use
cca push [--target=IP_ADDRESS] --watch
to begin continuous live deploy: the Chrome App is automatically refreshed when the code is updated.
Select your Chrome App. From the menu (the icon is three horizontal bars in the top left corner), select Deploy to Mobile...
and follow the instructions.
From the root of your cca
-generated project directory:
- To run your app on the Android Emulator:
cca run android --emulator
- Note: This requires that you have set up an emulator. You can run
android avd
to set this up. Download additional emulator images by runningandroid
. To make the intel images run faster, install Intel's HAXM.
- Note: This requires that you have set up an emulator. You can run
- To run your app on a connected ARM Android device:
cca run android --device
. - To run on a specific target:
cca run android --target=foo
- To see a list of available targets:
cca run android --list
- To run your app on the iOS Simulator:
cca run ios --emulator
- To run your app on a connected iOS device:
cca run ios --device
- Note: To run on a connected iOS device, you must set up a Provisioning Profile for that device.
- To run on a specific target:
cca run ios --target=foo
- To see a list of available targets:
cca run ios --list
- In Android Studio, select
Import Project
- Import from the
platforms/android
directory that was created within your project. - Click the play button to run your app.
-
Open the project in Xcode by typing the following in a terminal window:
cd YourApp open platforms/ios/*.xcodeproj
-
Make sure you are building the right target.
In the top left (beside Run and Stop buttons), there is a dropdown to select target project and device. Ensure that
YourApp
is selected and notCordovaLib
. -
Click the play button.
Your HTML, CSS and JavaScript files live within the www
directory of your cca project folder.
Important: When using an IDE, you must manually run cca prepare
before deploying your application. If you are deploying using cca
on the command-line, the prepare step is done automatically.
You can debug your Chrome App for Mobile the same way that you debug standard Cordova applications.
Important: In order to use remote debugging with chrome web inspector for Android, your desktop Chrome version should match the Chrome WebView on Android. In practice, this usually means you should be debugging using Chrome Dev/Canary. (If there is a version mismatch, usually the chrome web inspector window appears completely blank.)
Done? Continue to Step 4: Next Steps »