Giter Site home page Giter Site logo

Comments (12)

mortenjust avatar mortenjust commented on June 12, 2024

This would be great. Also planning on adb over wifi (mostly for Android TV). Do you think wifi could replace Bluetooth or do we need both?

from androidtool-mac.

c99koder avatar c99koder commented on June 12, 2024

Not all Wear devices will get WiFi support so supporting bluetooth too would be better. Not sure there would even be a difference though since they're both just going over TCP/IP from adb's perspective

from androidtool-mac.

vibin avatar vibin commented on June 12, 2024

I was wondering why the app wasn't working at all. I was using adb via tcp. I think it's pretty common and should be supported.

from androidtool-mac.

jlhonora avatar jlhonora commented on June 12, 2024

This should be fairly easy to implement:

diff --git a/AndroidTool/DevicePickerViewController.swift b/AndroidTool/DevicePickerViewController.swift
index d83cb81..ea385a9 100644
--- a/AndroidTool/DevicePickerViewController.swift
+++ b/AndroidTool/DevicePickerViewController.swift
@@ -30,7 +30,7 @@ class DevicePickerViewController: NSViewController, NSTableViewDelegate, NSTable
     }

     func installApkOnDevice(device:Device){
-        let serial = device.serial!
+        let adbIdentifier = device.adbIdentifier!

         for subview in view.subviews {
             var s = subview as! NSView
@@ -41,7 +41,7 @@ class DevicePickerViewController: NSViewController, NSTableViewDelegate, NSTable
         spinner.style = NSProgressIndicatorStyle.SpinningStyle
         spinner.frame.origin.x = view.bounds.maxX/2 - spinner.bounds.size.width/2

-        let args = ["\(serial)",
+        let args = ["\(adbIdentifier)",
                     "\(apkPath)"]

         //["\(serial) install -r \"\(apkPath)\""]

Tested over WiFi (and USB), works well.

I noted some more problems related to using the device's serial instead of the ADB identifier. For example:

// Device.swift:82
        ShellTasker(scriptFile: "getResolutionForSerial").run(arguments: ["\(self.serial!)"], isUserScript: false) { (output) -> Void in
            let res = output as! String

            if res.rangeOfString("Physical size:") != nil {
                self.resolution = self.getResolutionFromString(output as! String)
            } else {
                println("Awkward. No size found. What I did find was \(res)")
            }

        }

Which consequently logs:

+error: device not found
Awkward. No size found. What I did find was 
is nil
is nil

Perhaps self.adbIdentifiershould be used instead of self.serial here as well?

If you want I can prepare a PR but I don't feel too comfortable changing so many parts (basically every place where ShellTasker is called). What do you think?

from androidtool-mac.

jlhonora avatar jlhonora commented on June 12, 2024

Here's a diff that makes it work over WiFi: master...jlhonora:master

Tested APK install, screenshot, video recording and bug report script.

  • Can anyone try it with a Bluetooth device? I don't have any at hand.
  • @mortenjust , I couldn't find any contribution guidelines. Are there any? Does this fit as a pull request?

from androidtool-mac.

Dibel avatar Dibel commented on June 12, 2024

@jlhonora Thanks for your patch, it works fine with Moto 360 via bluetooth debug, including screenshot, recording(need tiny changes in the processing script) and bug report.

from androidtool-mac.

jlhonora avatar jlhonora commented on June 12, 2024

@Dibel Great! Could you elaborate on the changes for the processing script?

from androidtool-mac.

Dibel avatar Dibel commented on June 12, 2024

@jlhonora Yeah, but the change is for Moto 360's resolution (320x320). I don't know why the original command can't work.

diff --git a/AndroidTool/startRecordingForSerial.sh b/AndroidTool/startRecordingForSerial.sh
index 04f6d5a..cf80486 100644
--- a/AndroidTool/startRecordingForSerial.sh
+++ b/AndroidTool/startRecordingForSerial.sh
@@ -18,7 +18,7 @@ chara=$($adb -s $serial shell getprop ro.build.characteristics)
 if [[ $chara == *"watch"* ]]
 then
     echo "Recording from watch..."
-    $adb -s $serial shell screenrecord --o raw-frames /sdcard/screencapture.raw
+    $adb -s $serial shell screenrecord --size 320x320 --o raw-frames /sdcard/screencapture.raw
 else
     echo "Recording from phone..."

from androidtool-mac.

mortenjust avatar mortenjust commented on June 12, 2024

If anyone wants to contribute with a pull request that can solve this for all Android Wear screen sizes, I'd be happy to merge it in. Thanks!

from androidtool-mac.

jlhonora avatar jlhonora commented on June 12, 2024

Great. @Dibel, I have some changes that I'd like you to try in a real device, if that's possible. Let's talk via email (joseluishonorato at gmail) and I'll walk you through. Thanks in advance.

from androidtool-mac.

Dibel avatar Dibel commented on June 12, 2024

@mortenjust @jlhonora Tested OK on El Capitan with Moto 360. And I also migrated the app to Swift 2 to compile it on Xcode 7.

I've created a pull request #67, but please double-check it due to the huge changes.

from androidtool-mac.

mortenjust avatar mortenjust commented on June 12, 2024

Thanks! Went into 1.3.

from androidtool-mac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.