I don't think RubyMotion is ready for my Android (& iOS) project

Skip to first unread message

Gary McGhee

unread,
Mar 9, 2015, 11:50:46 PM3/9/15
to rubym...@googlegroups.com
I am developing a project for a client that needs to be on Android and iOS, and would otherwise be a Cordova project with a significant amount of native code in a plugin for each platform.
I love the concept of RubyMotion and have invested many hours in trying it out on Android. I don't have a suitable iOS device to test with longterm (I need the M7). As a long time Rails developer, I love the concept of one language (my favorite) on the server and both clients. 

Also both mobile clients being native, shared code, and without the complexity of Cordova plugins etc. is a massive point in RubyMotion's favour, and I really hope it gets there eventually, but I think I'm going to have to learn Java and maybe Objective C or Swift for this. I'm not sure about using RubyMotion for iOS only.

RubyMotion claims :
a) a REPL like irb : but you have to use "pro" and print-something-variables. You can't seem to just eval code (even in the REPL) which is half the benefit - to test code on the fly.
b) rspec like testing : but I just can't get past this issue https://github.com/HipByte/RubyMotion/issues/194
c) RubyMine IDE support : but not Intellij IDEA which I use for everything, and no debugging on Android
d) no static compile to a library on Android - which would enable creation of Cordova plugins in RubyMotion
e) I don't know what roadblocks I'll hit down the road either - this recent experience hasn't given me much confidence

So for coding I'm stuck with write-compile-install with logging and an almost useless REPL (is it worth learning gdb? Will it get me anywhere near irb?)

I think I'm going to try writing a native Android version, and hope I can convert to RubyMotion later to do the iOS version.

I just want to emphasis that being able to write the backend and both *native* mobile clients in Ruby is an AWESOME proposition, for Ruby developers and otherwise. Maybe I'm wrong, but I don't think it's there yet on Android, and the pace since the Android prerelease doesn't convince me I can use it right now while being paid for it (I can't afford any more of my own time).

lapo...@gmail.com

unread,
Mar 10, 2015, 9:11:31 PM3/10/15
to rubym...@googlegroups.com
Gary, I can't say much about the Android support.  But regarding the REPL, maybe I can offer some insight.

When I first started using RubyMotion, I also couldn't understand why the REPL seemed so underpowered, required using 'pro' and 'pri'.

If you're running the debugger, then you're not using the REPL, it's gdb and a PIA.  It would be great to have full REPL functionality at that level, but there isn't.

But, if you don't run in debug mode, then you do get a very powerful REPL.  I'm able to execute different ruby code, make API calls, etc.  Using bubble-wrap, you can get the delegate object very easily with `App.delegate`, and from there you can access different instance variables, etc. Sugarcube gives a great `tree` function for seeing the view heirarchy and interacting with it.

So in my experience it's quite powerful.  But I had to make a mental switch that I'm doing most of my debugging using the REPL console during a regular run of the code, and not through the "debugger".

I don't know if that helps at all...

Cheers,
Brett

Gary McGhee

unread,
Mar 11, 2015, 12:07:51 AM3/11/15
to rubym...@googlegroups.com
Actually, yes Brett, that does help a lot. I completely missed that the non-debug REPL is more like the normal ruby debugger than the debug REPL! It should be clearer in the documentation.

And by the way, what output do you get from "rake spec:device" ? Does it look anything like normal rspec output?

I get :

GaryMac:wifi_timer2 gary$ rake spec:device

Install ./build/Testing-16/wifi_timer2.apk

4092 KB/s (1269126 bytes in 0.302s)

Start com.yourcompany.wifi_timer2/.MainActivity

--------- beginning of system

--------- beginning of main

E/art ( 1136): Failed writing handshake bytes (-1 of 14): Broken pipe

I/com/yourcompany/wifi_timer2( 3180): false

I/com/yourcompany/wifi_timer2( 3180): -75

GaryMac:wifi_timer2 gary$ 

Thanks!

Gary

lapo...@gmail.com

unread,
Mar 12, 2015, 1:58:16 PM3/12/15
to rubym...@googlegroups.com

Gary,

Glad it helped.

Yeah, I get reasonable spec output

```
| => rake spec:device
     Build ./build/iPhoneOS-7.0-Development
....
    Deploy ./build/iPhoneOS-7.0-Development/Golden SK_spec.ipa
*** Application is running on the device, use ^C to quit.
Mar 12 18:50:05 digitalMoksha-iPhone-4S Golden SK[800] <Error>: assertion failed: 12B466: libxpc.dylib + 51955 [63E5390F-F156-3BDC-AD59-B826676CE6D0]: 0x7d
Mar 12 18:50:08 digitalMoksha-iPhone-4S Golden SK[800] <Warning>: Application 'quotedby'
Mar 12 18:50:08 digitalMoksha-iPhone-4S Golden SK[800] <Warning>:   - has one window
8 digitalMoksha-iPhone-4S Golden SK[800] <Warning>: 1 specifications (1 requirements), 0 failures, 0 errors
```

I don't know what the "assertion failed" is, but it's not affecting me at the moment.  Failure text looks like this

```
Mar 12 18:51:58 digitalMoksha-iPhone-4S Golden SK[806] <Warning>: Application 'quotedby'
Mar 12 18:51:58 digitalMoksha-iPhone-4S Golden SK[806] <Warning>:   - has one window
Mar 12 18:51:58 digitalMoksha-iPhone-4S Golden SK[806] <Warning>:  [FAILED - 1.==(2) failed]
Mar 12 18:51:58 digitalMoksha-iPhone-4S Golden SK[806] <Warning>: Bacon::Error: 1.==(2) failed
Mar 12 18:51:58 digitalMoksha-iPhone-4S Golden SK[806] <Warning>: 1 specifications (1 requirements), 1 failures, 0 errors
```

But this is on an iPhone, not an Android device - I have no idea if you get similar output or not...
Reply all
Reply to author
Forward
0 new messages