2018年1月8日

[Fun] Automatic android script by using adb.exe

§ Connect your device to your PC. 讓 PC 可以存取你的 android phone

1. download USB drivers, 下載 USB 驅動程式

    hTC user: http://www.htc.com/tw/support/software/htc-sync-manager.aspx
    Samsung user: http://developer.samsung.com/galaxy/others/android-usb-driver-for-windows
    Sony user: https://developer.sonymobile.com/downloads/drivers/
2. 打開開發者模式

   
    http://www.samsung.com/tw/support/skp/faq/1122707
    https://ppt.cc/fz2r1x

3. 進入開發人員選項,然後打開下面的設定

    3.1 - 打開 "USB 偵錯"
    3.2 - 手機和PC連線後,將usb設定成MTP

4. Adb

    4.1 Download ADB -
          https://blog.longwin.com.tw/2017/02/google-android-fastboot-adb-download-2017/

    4.2 解壓縮 adb 後,開始 -> 執行 -> cmd ->至adb資料夾

    4.3 執行adb devices ,如果看的到自己的手機,表示已成功連結

    4.4 接著可以使用 adb shell input swipe X0 Y0 X1 Y1 來實做滑手機,
          以及用 adb shell input tap X Y 實做點擊螢幕的動作

    4.5 x, y 座標可以到開發者模式中開始顯示座標

    4.6 Sample: https://ppt.cc/foA5ox

5. utility to generate .bat file

    5.1 Download here https://drive.google.com/open?id=1BqU9cThiBcxYPw8JDOtScz0NfgCIQVCd

    5.2 目前只會自動產生swipe 和 tap。tap的部份需再輸出delay time, swipe自動
          插入delay time 2 sec。