Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to a device (iPhone or Android) #18

Open
AmirNaghibi opened this issue Jan 3, 2022 · 3 comments
Open

Connecting to a device (iPhone or Android) #18

AmirNaghibi opened this issue Jan 3, 2022 · 3 comments

Comments

@AmirNaghibi
Copy link

Great project! I'm using your image and am able to create an app inside a flutter container.

Any tips on how to connect to a device? I have connected my iPad but after running flutter run I get an error:

No supported devices connected.

Is there any argument I need to pass when running a container? Currently I'm using the following command:

docker run --rm -it -h ubuntu -v $PWD:/software --name flutter -p 8080:8080 fischerscode/flutter /bin/bash
@AmirNaghibi
Copy link
Author

This is what I see after running flutter doctor :

Screen Shot 2022-01-03 at 9 24 09 AM

I believe I need to install Android SDK and probably XCode for iPhone? 🤔

@fischerscode
Copy link
Owner

Never tried this since I am only using the image to build a flutter web application.

Connecting the device to the container could be done using --device.

I assume it's pretty hard to run on an iPhone since it would require xCode to build the application.
Running on android might be possible by installing android studio.

@fischerscode
Copy link
Owner

fischerscode commented Jan 3, 2022

Mainly for documenting progress

By doing the following it, it is possible to build an apk using this image.
docker run --rm -ti fischerscode/flutter-sudo:stable

sudo apt-get update
sudo apt-get install -y libcanberra-gtk-module android-sdk software-properties-common
curl -o commandlinetools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip #link from https://developer.android.com/studio#command-tools
sudo mkdir -p /usr/lib/android-sdk/cmdline-tools
sudo unzip -d /usr/lib/android-sdk/cmdline-tools commandlinetools-linux.zip
sudo mv /usr/lib/android-sdk/cmdline-tools/cmdline-tools /usr/lib/android-sdk/cmdline-tools/latest

sudo /usr/lib/android-sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-29" "build-tools;32.0.0"
flutter create test
cd test
sudo /home/flutter/flutter-sdk/bin/flutter build apk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants