More gifs in the "gifs" folder.
Has only been tested on Windows + Android (other platforms should work with little code adjustments)
The PC and the device must be in the same private network.
No root, what so ever required.
Estimated set up time: 8 minutes
https://www.dartlang.org/tools/sdk#install
If it is not, put it into the path (https://docs.alfresco.com/4.2/tasks/fot-addpath.html)
git clone https://github.com/Norbert515/flutter_experiment_phone_ide.git
Copy the "ide" folder under "https://github.com/Norbert515/flutter_experiment_phone_ide/tree/master/flutter_experiment_phone_ide/lib" into your project
Add these three dependencies into your pubspec.yaml and run packages get
rpc: ^0.6.0
http: ^0.11.0
path: ^1.6.2
Wrap your home page with the IdeApp
widget:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.red,
),
home: IdeApp(child: new MyHomePage()),
);
}
}
flutter_experiment_phone_ide/flutter_experiment_phone_ide_server/bin/
pub get
If you want to test it on your phone without a cable : It still goes through adb, but wirelessly. Here is a very quick set up for that https://futurestud.io/tutorials/how-to-debug-your-android-app-over-wifi-without-root
Then run
flutter devices
The device ids are 192.168.0.101:5555, Desktop, Small respectively.
It takes 2 arguments
--projectPath=<path_to_the_project_you_want_to_develop_on_your_phone>
--deviceId=<adb_device_id_to_run_this_on>
This is how it could look like:
dart server.dart --projectPath="C:\Users\Norbert\workspace\flutter_experiment_phone_ide\flutter_experiment_phone_ide" --deviceId="172.23.218.234:5555"
Navigate to the folder "ide" you copied to your project. Open the ide.dart
file.
On line 8, change the rootUrl
to the server IP.
Here is an example:
TestApi testApi = TestApi(http.Client(), rootUrl: "http://192.168.0.179:8080/");
The link is:
<server_local_ip>:<port>/test/v1/coldStart
If you want to develop apps anywhere you go, you will have to set up a VPN to connect the phone and the PC.
When the App opens, swipe to the right (there is a hidden drawer to the left) to open the IDE settings. There you can enable the IDE and select a file to edit.