jberkel / android-plugin

An sbt plugin for Android development in Scala
https://groups.google.com/forum/#!forum/scala-on-android
Other
476 stars 113 forks source link

New command to preload Scala on a device/emulator #165

Closed fxthomas closed 11 years ago

fxthomas commented 11 years ago

Here is a new command to quickly setup your device (or emulator) for Scala development.

It predexes the Scala libs then pushes them to the device, most of it being heavily inspired by svenwiegand/scala-libs-for-android-emulator. These are the two main commands you can use :

I tested it on my device (Galaxy Nexus running Cyanogen 10.1-M2) and it apparently runs flawlessly.

appamatto commented 11 years ago

Francois, your code assumes that the user has remounted /system/etc/permissions as read-write in the emulator, right?

appamatto commented 11 years ago

Also, what do you think about versioning the xml file as well? This would support, say, working on two apps that have different scala versions on the same device.

appamatto commented 11 years ago

Another important point is that the /system partition is not persisted across reboots, so the work done by android:preload-emulator gets wiped out immediately.

fxthomas commented 11 years ago

Ah, I see, I only tested on a real device, I don't use the emulator. The /system partition is mounted as read-write automatically anyway.

Maybe some pointers here, I'll look into it : http://blog.thecobraden.com/2012/06/making-persistent-changes-to-android.html and http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images#Background

appamatto commented 11 years ago

I also noticed that my mod doesn't enable "adb root", which device rooting method did you test this with?

fxthomas commented 11 years ago

adb root should work on stock ROMs, but if you use CyanogenMod you have to explicitly enable root for ADB under the development options. I don't know about other mods.

fxthomas commented 11 years ago

(Good point by the way, it's a good idea to stop with an error if adb root fails)

appamatto commented 11 years ago

(for anyone who stumbles upon this) I used adbd Insecure to enable adb root access on my stock ROM. Apparently this is needed in addition to root.

appamatto commented 11 years ago

Let's go ahead and merge this since it doesn't conflict with other functionality and the device portion is quite useful.

We should try to resolve the emulator issue if possible, though.