@jaen: I did some exploration of chromium sources and there is no flag which should prevent device discovery/functionality in dirac. It seems that all the functionality is implemented on “backend” side, and devtools just query it over the protocol. There should be no difference between remote or bundled.
if you still have that diract setup, here is one thing you could try:
1) on <chrome://extensions> open Dirac DevTools options dialog and change it to open as a new window
2) open dirac
3) in the url you should see something like:
<chrome-extension://mjdnckdilfjoenmikegbbenflgjcmbid/devtools/front_end/inspector.html?dirac_flags=11111&ws=localhost:9222/devtools/page/7594DED5-9206-448A-8D64-6C4A93149F1C>
replace it with
<chrome-devtools://devtools/bundled/inspector.html?ws=localhost:9222/devtools/page/7594DED5-9206-448A-8D64-6C4A93149F1C>
just keep the ws parameter
4) you should see internal (bundled) devtools running in external window instead of Dirac devtools using remote debugging protocol (the panel highlighting underline is blue instead of green)
5) now you can test it again
unfortunately I don’t have any android device, so I’m unable to test it here on my machine
@darwin: I don't even have any smartphone, I just test with an emulator, Chrome picks that up as a normal device, so this should be testable w/it. I'll try what you say today and see if that helps.
@jaen could you please point me to the emulator you are using? I’m not familiar with Cordova / Android development. Just tell me what to install so I can test it too
Just the usual Android emulator from the SDK. You can find sample Cordova app here - https://github.com/enterlab/cordevicljs/
After you install the Android SDK, create a VM with android avd
and run it, Cordova should be able to deploy inside it when you do cordova run android
.
ok, thanks
btw. what are you working on? just curious
I don't think I can say much more apart from "a hybrid mobile application client for someone".
hehe, hope it will be the next billion dollar app..
:simple_smile:
Probably not that big, but the idea seems sound, so hopefully it takes off.
Since you're here, is the 47 hard dependency for mobile formatters? I remember it working with older versions?
mobile formatters?
you mean custom formatters?
…
Yes, of course I do
Sorry
that feature had some development over 3-4 months early in 2015, it was hidden behind experimental flag, so it was present, but wasn’t exposed
it should be avail in 46 when you do some specific steps
Yeah, I remember having to do the secret shift trick first time I used cljs-devtools
.
how old chrome do you target?
if it is build after feb 2015, it should work
I'd have to check again, think it was 44 or 45 that backs the webview in Cordova.
see <chrome://version/>
I’m trying to create a new emulated device via that android avd gui, but the target select box is empty, how do I get some targets?, I used brew install android-sdk
same as this guy: http://stackoverflow.com/questions/14000200/unable-to-create-android-avd-because-of-target-and-cpu-abi-settings
ah, I got it, first I have to run android
and install addtional stuff
Yes, you have to install at least one API level in that SDK manager.
Plus all the tools.
I accepted the defaults, downloading
Also, make sure you have the appropriate paths in PATH: /home/jaen/android-sdk-linux/tools:/home/jaen/android-sdk-linux/platform-tools/:/home/jaen/android-sdk-linux/build-tools
It'll be of course somewhat different for a Mac, but probably the three same subdirectories
Cordova didn't work for me at first until I realised I missed one of the subdirectories that contained adb
I think.
@darwin: just did what you described above and it doesn't work as well.
ok, so it is not dirac, but really limitation in the protocol
Yep, it appears so.
BTW the user agent is: "Mozilla/5.0 (Linux; Android 6.0; Android SDK built for x86_64 Build/MASTER; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Safari/537.36"
That's mid-2105
yep, https://chromium.googlesource.com/chromium/src.git/+/44.0.2403.119
so it should have formatters behind that shift trick
cljs-devtools
tests the user agent though, what do you think about a :skip-version-check
parameter to the install function?
it tests the version only for dirac feature
not for custom formatters, I believe
try calling
(devtools/set-pref! :legacy-formatter true)
before install!
call
You sure it doesn't test though?, I'm getting this:
core.js:15 Feature 'custom-formatters' cannot be installed. Unsupported browser Mozilla/5.0 (Linux; Android 6.0; Android SDK built for x86_64 Build/MASTER; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Safari/537.36.
I'll try that
that message must be from Chrome or devtools itself, not from cljs-devtools
wait
you are right I do check for it here: https://github.com/binaryage/cljs-devtools/blob/master/src/devtools/custom_formatters.cljs#L13
you should be able to override that available? method to always return true
from the top of my head:
(set! js/devtools.custom_formatters “available_QMARK_" (constantly true))
maybe there is a better way how redefine dynamic var
I'm not sure there is, that should do the trick, let me check
Well, it does skip the check, but they don't seem to be working unfortunately. Thanks for the help though!
did you enable them in the settings? did you set the legacy formatter option?
also be sure you refresh whole devtools by closing it and opening again
that setting for enabling them acted weirdly in old versions
Yes, I remember all that, been using cljs-devtools
back then too. It just seems there's no options in settings for that when I open device inspector.
I don’t know what is device inspector, you need to open devtools -> settings (F1)
btw. I was able to use custom formatters in pretty old Electron build (in Atom editor) back in Aug
that is why I have that :legacy-formatter option there
I'm not sure what it's called, it's what happens when you do More tools -> Inspect Device…
then choose the device and click Inspect
ok, maybe you have slightly incompatible devtools with the “backend” running in the phone
so your devtools have enabled custom formatters in settings, right?
those embedded in Chrome do, yes
I suppose it's either another limitation of the devtools when they are not embedded.
Or maybe 44 is just too old.
remote devtools work with custom formatters (dirac is an example)
you should try to refresh the page in the phone after you connect the devtools, that custom formatter enabling switch has to propagate somehow to the “backend"
Yeah, but the "inspect" devtools don't have option to enable them, so maybe it's just something that's not supported either in 44 or when inspecting a device.
ah, maybe 44 was release in Aug 2015, but it actually compiled much older code, let me see
I think I remember using formatters with 43
But that was with the mash-shift-trick
And those devtools don't even have "experiments" option tab.
So I guess I'm just out of luck
I’m trying to figure out what exact version of code was compile in there. I think you could try to use older devtools build. Download chrome 44 and try to enable custom formatters there
I think matching version of chrome-devtools and remote backend has higher chance of success.
also if you don’t find custom formatters option there (after that shift trick), it means it is probably not yet avail
Yeah, I'll try that later; though probably I'll have to accept that debugging a hybrid app won't be as nice as debugging a web app after all.
I'm curious if it would be better with React Native or not, but I don't have anything to test that with ATM.
the support for CFs is just a question of time, until Android decides to include more recent version of Chrome
Yeah, but I'm running 6.0 in the emulator and it reports as 44, so it'll probably be a while yet.
hmm, https://developer.chrome.com/multidevice/webview/overview#will_the_new_webview_auto-update_
there could be a way to update it maybe?
maybe try this inside the phone? http://android-developers.blogspot.cz/2015/02/beta-channel-for-android-webview.html
The emulator doesn't seem to have Google Play but I'll keep experimenting, thanks for the pointers
The group (https://plus.google.com/communities/105434725573080290360) says it's currently 49 so if I get the store working it might be helpful
your employer should buy you a nice new phone, I think 😉
I'll be getting one in a week or so, but if I can figure it out before that - why not try; I'll know what to do when I get a real phone.