RON WU
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ###### tags: `airtest` `安裝手冊` # Airtest安裝手冊 [TOC] ## 環境安裝 1. 在MAC上安裝python3:https://programwithus.com/learn/python/install-python3-mac (1) 安裝Xcode (App Store -> Xcode) (使用Android此步驟可以忽略) (2) 安裝Brew (https://brew.sh) A. 把指令貼到Terminal /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ![](https://hackmd.io/_uploads/B1C8E9p83.png) B. 打電腦密碼和enter開始安裝,然後再打一次密碼 ![](https://hackmd.io/_uploads/SywXS5pUh.png) C. 安裝完成,並依照兩步驟把Homebrew加到路徑 (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/esunsec_moda/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" ![](https://hackmd.io/_uploads/B1d0S5pLn.png) D. 加完路徑 ![](https://hackmd.io/_uploads/HyEZ896Lh.png) E. 檢查是否安裝成功 brew --version ![](https://hackmd.io/_uploads/B1TYU9pLh.png) (3) 安裝python3 A. 把指令貼到Terminal brew install python3 ![](https://hackmd.io/_uploads/Sy40w5p83.png) B. 檢查是否安裝成功 python3 --version ![](https://hackmd.io/_uploads/Sy-SOcpIn.png) 2. 安裝pocoui、airtest套件 (要在電腦跑python的使用者才需要做) pip install pocoui pip3 install pocoui pip install airtest pip3 install airtest 3. 安裝AirtestIDE (非開發人員不用裝) (1) 前往 https://airtest.netease.com ,下載MACOS VERSION ![](https://hackmd.io/_uploads/S1rXVj6Un.png) (2) 點擊AirtestIDE,安裝Rosetta ![](https://hackmd.io/_uploads/r1OUNiaUn.png) (3) 安裝完再點一次AirtestIDE,出現無法驗證開發者 ![](https://hackmd.io/_uploads/r1Vodj6I2.png) (4) 解決”來自未識別的開發者問題”,強制開啟權限 A. 前往系統設定 -> 隱私權與安全性 -> 下拉到”安全性”看到AirtestIDE -> 點選強制打開 ![](https://hackmd.io/_uploads/BJAxKs6Ln.png) B. 參考來源:https://app.yipee.cc/92743/%E3%80%90macos-%E6%95%99%E5%AD%B8%E3%80%91%E6%95%99%E4%BD%A0%E8%A7%A3%E6%B1%BA%E3%80%8C%E7%84%A1%E6%B3%95%E6%89%93%E9%96%8B-xxx%EF%BC%8C%E5%9B%A0%E7%82%BA%E5%AE%83%E4%BE%86%E8%87%AA%E6%9C%AA%E8%AD%98/ (5) 自動跳出Login視窗,按skip跳過 (6) 成功跳出AirtestIDE ![](https://hackmd.io/_uploads/Byu_YspL3.png) 4. 安裝VS code (1) ## Android 手機 步驟1和2各家手機步驟不同,需自行上網查 1. 手機開啟開發者模式(USB偵錯)和螢幕截圖功能 2. E-Trader開啟螢幕截圖功能 (系統設定->其他->螢幕截圖開關)(iPhone沒有這個功能) 3. 手機連上電腦(開啟允許USB偵錯) 4. 點選refresh ADB,看到上面Mobile Phone Connection出現手機 ![](https://hackmd.io/_uploads/Hy0c9saUh.png) 5. Action點選connect,看到手機畫面出現在電腦上 ![](https://hackmd.io/_uploads/r1lr2s6Ih.png) ## iOS 手機 參考網站:https://blog.csdn.net/weixin_42550871/article/details/109727429 1. 手機開啟開發者模式 可以從電腦搜尋Tenorshare Icarefone下載第三方程式->快捷操作編輯->開啟開發者模式->手機 ->隱私權與安全性->開發者模式->開啟 教學:https://applefans.today/icarefone-2022-ios-16-enable-iphone-developer-mode/ 2. 電腦前往:https://github.com/AirtestProject/iOS-Tagent.git ,點選Code、Download ZIP 備註:目前改用appium的WDA(放在電腦->文件) 網址:https://github.com/appium/WebDriverAgent ![](https://hackmd.io/_uploads/HJGCnYHP3.png) 3. 前往下載檔案的iOS-Tagent-master,開啟”WebDriverAgent.xcodeproj”,點選信任和開啟 ![](https://hackmd.io/_uploads/Hy_xaYHvn.png) 4. 手機用USB連線到電腦 5. 點選Xcode畫面上方(不是WebDriverAgent畫面本身)的”Product”->”Destination”->你的測試設備 ![](https://hackmd.io/_uploads/BJDG6trwh.png) 6. 點一下最左側的”WebDriverAgent”->左二側欄位”TARGETS”->”WebDriverAgentRunner”->右側欄位選”Signing & Capabilities”->”Team”->”Add an Account” ![](https://hackmd.io/_uploads/BkW4TFBw3.png) 7. 輸入資訊處提供的Xcode Apple ID和密碼(可能會更換) ![](https://hackmd.io/_uploads/rybB6YSv3.png)![](https://hackmd.io/_uploads/SJFBTKBD2.png) 8. 左側欄位”TARGETS”->”WebDriverAgentRunner”->右側欄位選”Build Settings”->”Basic”->找到Packaging的”Product Bundle Identifier”,修改中間的字串成「esunsecmoda2」 ![](https://hackmd.io/_uploads/S1rP6YHvh.png) 9. 回去”Signing & Capabilities”,確認iOS和macOS有無報錯 ![](https://hackmd.io/_uploads/rJIu6YBwh.png) 10. 切換到General的"Deployment Info" 的iOS切換到與手機相同 10. 點選Xcode畫面上方的”Product”->”Scheme”->”WebDriverAgentRunner”切換 ![](https://hackmd.io/_uploads/S1uYTYSv2.png) 11. 點選Xcode畫面上方的”Product”->”Test” ![](https://hackmd.io/_uploads/Sk556KSP3.png) 12. 等待Building時跳出請求密碼權限,輸入電腦登入密碼按永遠允許(有bug要多輸入幾次) ![](https://hackmd.io/_uploads/SyFjpFHDn.png) 13. 跳出尚未信任WebDriverAgentRunner通知,點選OK ![](https://hackmd.io/_uploads/BkgPnaYBD3.png) 14. 信任來源 手機->設定->一般->VPN與裝置管理->在開發者APP會看到”Apple Development:資訊處提供的Apple ID”顯示”不受信任”->點進去按信任->回前頁會看到”不受信任”消失 ![](https://hackmd.io/_uploads/Sy_yRFSw2.png)![](https://hackmd.io/_uploads/BJT1CKHP2.png)![](https://hackmd.io/_uploads/SyfxAFrvn.png) 15. 點選Xcode畫面上方的”Product”->”Test”,會看到Build Succeeded 16. 設置手機和電腦的代理窗口 (1) 安裝libusbmuxd,把指令貼到Terminal ``` brew install libusbmuxd ``` (2) 把指令貼到新Terminal,會看到waiting for connection iproxy 8100 8100 ![](https://hackmd.io/_uploads/ryvhAKBD3.png) 17. 開啟AirtestIDE,點選IOS App Connection的Connect,即可開始連接 (手機同時顯示”Automation Running”表示成功) ![](https://hackmd.io/_uploads/r1Fck9Hv3.png) ## 其他(crontab 排程) 1. 預設瀏覽器 開啟log.html一定要用google chrome(設為預設瀏覽器),否則圖片會找不到 2. 客服crontab排程指令 40 07 * * 1,2,3,4,5 sh /Users/esunmoda/shell/customer_daily_check.sh>>/Users/esunmoda/shell/customer_daily_check.txt # Airtest遇到問題及解決方法 ## iOS被強制升級版更(2023.10.13) 1. 原本解決方法是要將手機從17退版至16,但使用許多方法皆無法讓手機成功降版。因此後來採取先升級macOS到Sonoma 14.0,然後再升級Xcode至15.0,最後才成功讓iOS 17成功連接macOS的Xcode。 ## 變更手機控制台設定(2023.10.25) 1. 因測試Etrader_Android開啟手機內建指紋辨識功能,以致隔天客服測試A+Android時,登入畫面跳出啟動指紋辨識詢問視窗,使腳本無法正常執行。 2. 解決方法:點選視窗的"不再顯示"功能,重新登入後已不會出現。未來如果使用同一支手機做其他設定(尤其是可能會影響所有App的控制台設定),測試完後必須還原原本設定,並且重新執行腳本確認例行測試正常無誤。 ![](https://hackmd.io/_uploads/Byq9H1IM6.png =20%x) ## 多台裝置共用相同Apple ID(2023.11.10) 1. 因公司多台Apple裝置使用相同Apple ID帳號(黃玉山,esunec88@gmail.com),其他裝置登入此帳號時,手機跳出"裝置已加入你的帳號"通知,使腳本無法正常執行。 2. 解決方法:前往"設定",登出此Apple ID。避免未來其他裝置登入時跳出通知,並確保登出後能與Xcode連線、執行自動化測試腳本等。 3. 注意事項:若未來透過App Store更新App時需登入帳號(用公司或個人帳號皆可),更新完畢需記得登出帳號,避免被公司或個人其他裝置影響跳出通知。 # MacOS重啟要做的事 ## xcode連結iOS 1. Product->Test->手機密碼131313 ## 命令提示字元 1. (必)iOS:iproxy 8100 8100 2. (必)selenium_CTS連線已開啟的Google Chrome(三個指令): https://blog.51cto.com/u_9453611/5569717 (1)export PATH="/Applications/Google Chrome.app/Contents/MacOS:$PATH" (2)source ~/.zshrc (3)Google\ Chrome --remote-debugging-port=9222 --user-data-dir="~/ChromeProfile" 3. (選)排程:「crontab -l」、「crontab -e」(編輯)=>i(輸入)=>「:wq」(儲存並離開) # 各平台憑證到期日(至少前一個月要展延並更新在這) 1. Android_Etrader:2024/11/27 2. Android_A+:2024/11/28 (帳務查詢->右上角帳號管理) 3. iOS_Etrader:2024/10/31 4. iOS_A+:2024/10/18 (交易功能->右上角帳號管理) 5. CTS:2024/07/31 (然後要去local storage把憑證資訊輸入到python檔裡面的key_values_to_import,讓新開啟的Chrome可以取得原本瀏覽器裡面的憑證資訊) # Android_Etrader系統設定 1. 登入設定->關閉「啟用快速登入」 2. 下單設定->關閉「委託主動回報、成交主動回報」 3. 下單設定->開啟「價格預設價為成交價」 4. 訊息通知設定->關閉全部 5. 其他->關閉「帳號資訊預設隱藏」 6. 其他->開啟「螢幕截圖開關」 7. 推播設定關閉:個股小叮嚀、申購通知、智慧下單、交割款提醒、活動快訊、股票申購通知 # Android_A+系統設定 1. 關閉下單匣設定->下單前再次確認視窗 2. 關閉訊息提示通知 3. 關閉推播設定(全) 4. 關閉主動回報所有設定 5. 開啟螢幕截圖開關 6. 關閉憑證申請訊息提醒開關(目前有bug,暫不動) # iOS_A+系統設定 1. 推播設定只開警示訊息、系統公告、成交回報 2. 關閉主動回報 3. 關閉登入訊息提醒 4. 關閉憑證申請訊息提醒開關(目前有bug,暫不動) 5. App Store更新完後須登出iphone,避免遇到多台裝置共用Apple ID # iOS_Etrader系統設定 1. 登入設定->關閉啟用快速登入 2. 下單設定->關閉委託主動回報、成交主動回報、點價帶下單 3. 下單設定->開啟價格預設為成交價 4. 訊息通知設定->關閉全部 5. 其他->關閉帳號資訊預設隱藏 6. App Store更新完後須登出iphone,避免遇到多台裝置共用Apple ID

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully