NOTE: 1.2.0 is the last version published using
addSbtPlugin("com.hanhuy.sbt" % "android-protify" % "1.2.0")
,
all future updates can be accessed by using
addSbtPlugin("org.scala-android" % "sbt-android-protify" % VERSION)
idea-sbt-plugin
to run SBT inside of Android Studiosbt-android-gradle
SBT plugin to automatically load your gradle build. From the base of your
Android project, do:
mkdir project
echo 'addSbtPlugin("org.scala-android" % "sbt-android-gradle" % "1.3.2")' > project/plugins.sbt
echo >> project/plugins.sbt
echo 'android.Plugin.withVariant("PROJECT-NAME (e.g. app)", Some("BUILD-TYPE"), Some("FLAVOR"))' > build.sbt
echo >> build.sbt
Some(...)
with None
if you don't have a flavor or build type to applysbt-android-protify
plugin, also from the project base, do:
echo 'addSbtPlugin("org.scala-android" % "sbt-android-protify" % "1.4.4")' >> project/plugins.sbt
echo 'enablePlugins(AndroidProtify)' > APP-PROJECT-DIR/protify.sbt
sbt
(first time's gonna take a while, downloading the internet and all)PROJECT-NAME/android:install
(or run
instead of install
) -- the first
time will take a while too, since it will download the parts of the
internet that your app requiresPROJECT-NAME/protify
, do ~PROJECT-NAME/protify
to
automatically trigger on all source changesecho 'addSbtPlugin("org.scala-android" % "sbt-android" % "1.7.7")' > ~/.sbt/0.13/plugins/android.sbt
sbt "gen-android ..."
to create a new project, sbt gen-android-sbt
to
generate sbt files in an existing project. Non-trivial projects will need
more advanced sbt configuration.
sbt-android-gradle
when working with an existing gradle project:
echo 'addSbtPlugin("org.scala-android" % "sbt-android-gradle" % "1.3.2")' > project/plugins.sbt
echo 'addSbtPlugin("org.scala-android" % "sbt-android-protify" % "1.4.4")' >> project/plugins.sbt
AndroidProtify
: echo enablePlugins(AndroidProtify) >> build.sbt
devices
and device
commands. Run
on all devices by executing set allDevices in Android := true
android:run
, and ~protify
protify:install
and protify:run
to pretend the app is getting updated, rather than
using the live-code mechanism.To make it so that protify can be run when triggered in the IDE with a keystroke, do the following
Run
configuration, press the dropdown next to the play button,
select Edit Configurations
+
-> Android Application
protify
, instant run
, or whatever you likeapp
moduleDo not deploy anything
Do not launch activity
Activate tool window
Make
from Before launch
Before launch
-> +
-> Add New Configuration
-> SBT
protify
protify
directly as a run configuration and see changes
instantly (FSVO instant) appear on-device.android:install
again (i.e.
adding/removing: activities, services, permissions, receivers, etc).
Incremental deployment cannot modify manifest.R
classes (removing resources) will require
running protify:clean
or else the build will breakBundle
d state will be restored in all situationsprotify
updates when jni code changes).so
libraries from the build
environment to the device, placing them into the correct location and
triggering an app restartMultiDexTestRunner