(These may be adapted to your needs.)
- Clean environment yet without any dart, flutter or android studio
- FlutterRoot: c:\
- FlutterDir: $(FlutterRoot)\flutter
- AndroidStudioRoot: c:\
- AndroidStudioDir: $(AndroidStudioRoot)\AndroidStudio
- RSMobileDir: c:\RS-Mobile
- RSPlatformTools: C:\Users\LOCALWINUSERNAME\AppData\Local\Android\Sdk\platform-tools
- Download and install any flavour of git for windows.
(see: https://flutter.dev/docs/get-started/install/windows#system-requirements) - Download Flutter stable:
https://flutter.dev/docs/get-started/install/windows#get-the-flutter-sdk - Open the zip-package and copy the contained flutter-dir to FlutterRoot.
This results in the FlutterDir. - Add in environment variables of your account to the PATH-variable of USER context separated by ';' the explicit full path to flutter\bin: $(FlutterDir)\bin
- Test:
Start a cmd console (in START/RUN type:cmd
) - type:
flutter -h <return>
flutter should show you its help text if all is well until now.
- Test:
- in cmd type:
flutter doctor <return>
- flutter checks its environment and will most likely tell you, that
- Android SDK is missing
- Android Studio is missing
- it may also query for chrome but this is not needed
- flutter checks its environment and will most likely tell you, that
- install Android Studio for windows:
https://developer.android.com/studio- follow the default setting and ensure the installation is done to AndroidStudioDir
- After installation start Android Studio and let it update if it queries for some
- press NEXT-buttons until it is no longer shown
- press FINISH and follow until finish
- On Wellcome-Page go into plugins and
- install dart
- and flutter
- and let AS restart
- On welcome page select projects: More Action/SDK Manager and than Tab SDK-Tools.
- Ensure all "Android SDK"* Entries are installed and especially
- ensure "Android SDK command line tools" to be installed
- Close the SDK Dialog
- If you wish to use simulated mobiles you may later select in "more actions" AVD Manager and create emulated devices as you need.
- tell Flutter where to find AS:
in cmd console type:
flutter config --android-studio-dir "$(AndroidStudioDir)"
The quotes are mandatory if the path conatains for exc. BLANKs - now you need to accept the SDK licenses:
in md type:
flutter doctor --android-licenses
and accept all.
- In new cmd-console type:
flutter doctor
it should now tell all (but maybe chrome) is OK.
- Git: clone RS mobile locally as RSMobileDir
(https://github.com/RetroShare/retroshare-mobile) - Open a cmd window (type cmd in START)
- change directory into RS mobile dir
- type:
flutter pub get<return>
to update the flutter package dependancies as needed in the project. - open the RSMobileDir in Android Studio
- Within the opened Android Studio on the left side in the project-tab open the path:
"retroshare-mobile/android/app/src/main/java/io/GeneratedPluginRegistrant.java" - Start "GeneratedPluginRegistrant.java" by dobbleclick on it.
- On the right side on top of the opened registrant:
if you see a note "Module SDK is not defined",
than click the button "Setup SDK" on the right side of this note. - In the opened dialog select any android SDK and click OK.
- Restart Android Studio.
Now your project - this is to do in any new project - is able to define and use emulated Phones.
- in settings type usb in search
- select usb-debugging
- activate it
- plug the mobile with usb to the pc
- if this is the first time a dialog appears to accept the key; accept it
- check in cmd console if the device is available
- cmd:
flutter devices<return>
should now list your mobile as availabel
- cmd:
- plug in the USB of the phone
- activate: USB-usage file transfer
- load the service apk to the mobile and install it
- For your convenience:
Add in environment variables of your account to the PATH-variable of USER context separated by ';' the explicit full path to the command_tools: $(RSPlatformTools) where the adb.exe houses which we will need. - Open a cmd-console within the directory of your service apk
- type in cmd:
adb install "YOUR_SERVCIE_APK.apk" <return>
Type in cmd console:
flutter run [[--release]]<return>
without release it will run in debug mode
RS-Mobile is debugable simply with Android-Studio as usual with. Just intuitiv and relative comfortable.
Open a cmd-console in the directory of the android ../sdk/patform-tools. There you will find the adb.exe (Android Debug Bridge). This tool enables you for excample to get the tracefiles from your android-device by
adb logcat > trace.txt<return>
You may filter the content of trace.txt than by "restroshare" to get only the lines of the client and the service without other android contextual activities.
TBD; actual not knwon how to setup a debug-environment fort it.
Hints in context: https://gitlab.com/elRepo.io/elRepo.io-android/-/issues/43
As above with the adb.exe tool.
If you want manually check the communication interface of the servcice
you may use the cUrl tool.
To use it you must establich a redirection of the ports by:
adb forward tcp:9091 tcp:9092
than you should be able to talk to the servcie direcly
for exc. like:
curl http://127.0.0.1:9091/RsJsonApi/version -v
This would for exc generate an output like
Trying 127.0.0.1...
TCP_NODELAY set
Connected to 127.0.0.1 (127.0.0.1) port 9091 (#0)
GET /RsJsonApi/version HTTP/1.1
Host: 127.0.0.1:9091
User-Agent: curl/7.55.1
Accept: */*
HTTP/1.1 200 OK
Access-Control-Allow-Headers: Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Length,Content-Range
Connection: close
Content-Length: 116
Content-Type: application/json
{"major": 0,
"minor": 6,
"mini": 6,
"extra": "-38-g25f58bc10",
"human": "0.6.6-38-g25f58bc10"
}* Closing connection 0